Skip to content

Commit

Permalink
Merge pull request #6 from julianmendez/20-introduction-of-tiles
Browse files Browse the repository at this point in the history
20 introduction of tiles
  • Loading branch information
julianmendez authored Dec 25, 2023
2 parents 97e81bc + 11fccad commit 96d9435
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 68 deletions.
3 changes: 3 additions & 0 deletions docs/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- date: 'not released'
- build: sbt '++ 3.3.1' clean compile test package assembly
- release: target/scala-3.3.1/soda-0.20.0.jar
- deprecated_features:
- the `theorem` reserved word is no longer used, and its functionality is replaced by
`directive`
- - version: v0.19.0
- date: '2023-07-01'
- build: sbt '++ 3.3.0' clean compile test package assembly
Expand Down
58 changes: 2 additions & 56 deletions documentation/src/site/tex/common/language.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\usepackage{listings}

\lstdefinelanguage{Soda}{
morekeywords={lambda, any, def, if, then, else, match, case, class, extends, abstract, end, this, subtype, supertype, false, true, not, and, or, package, import, theorem, proof, @new, @tailrec, @override},
morekeywords={lambda, any, def, if, then, else, match, case, class, extends, abstract, end, this, subtype, supertype, false, true, not, and, or, package, import, directive, @new, @tailrec, @override},
sensitive=true,
morecomment=[s]{/*}{*/},
morestring=[b]"
Expand Down Expand Up @@ -76,8 +76,7 @@
\newcommand{\sodapackage}{\reservedWordSoda{package}}
\newcommand{\sodaimport}{\reservedWordSoda{import}}

\newcommand{\sodatheorem}{\reservedWordSoda{theorem}}
\newcommand{\sodaproof}{\reservedWordSoda{proof}}
\newcommand{\sodadirective}{\reservedWordSoda{directive}}

\newcommand{\sodanew}{\annotation{@new}}
\newcommand{\sodatailrec}{\annotation{@tailrec}}
Expand All @@ -88,56 +87,3 @@
\newcommand{\sodalessthancolon}{\reservedWordSoda{<:}}
\newcommand{\sodagreaterthancolon}{\reservedWordSoda{>:}}

%
% Scala reserved words
%

\definecolor{scalablue}{rgb}{0.20, 0.00, 0.65}
\newcommand{\reservedWordScala}[1]{{\color{scalablue}\srccode{#1}}\xspace}
\newcommand{\scalaType}[1]{\basicType{{#1}}}

\newcommand{\scalacase}{\reservedWordScala{case}}
\newcommand{\scalaclass}{\reservedWordScala{class}}
\newcommand{\scaladef}{\reservedWordScala{def}}
\newcommand{\scalalazy}{\reservedWordScala{lazy}}
\newcommand{\scalasealed}{\reservedWordScala{sealed}}
\newcommand{\scalasuper}{\reservedWordScala{super}}
\newcommand{\scalatrait}{\reservedWordScala{trait}}
\newcommand{\scalaval}{\reservedWordScala{val}}
\newcommand{\scalavar}{\reservedWordScala{var}}
\newcommand{\scalawhile}{\reservedWordScala{while}}


%
% Coq reserved words
%

\definecolor{coqblue}{rgb}{0.05, 0.15, 0.65}
\newcommand{\reservedWordCoq}[1]{{\color{coqblue}\srccode{#1}}\xspace}
\newcommand{\coqType}[1]{\basicType{{#1}}}

\newcommand{\coqif}{\reservedWordCoq{if}}
\newcommand{\coqthen}{\reservedWordCoq{then}}
\newcommand{\coqelse}{\reservedWordCoq{else}}

\newcommand{\coqlet}{\reservedWordCoq{let}}
\newcommand{\coqin}{\reservedWordCoq{in}}

\newcommand{\coqmatch}{\reservedWordCoq{match}}
\newcommand{\coqwith}{\reservedWordCoq{with}}
\newcommand{\coqcasebar}{\reservedWordCoq{|}}
\newcommand{\coqcasearrow}{\ensuremath{\Rightarrow}\xspace}
\newcommand{\coqendmatch}{\reservedWordCoq{end}}

\newcommand{\coqDefinition}{\reservedWordCoq{Definition}}
\newcommand{\coqNotation}{\reservedWordCoq{Notation}}
\newcommand{\coqInductive}{\reservedWordCoq{Inductive}}
\newcommand{\coqFixpoint}{\reservedWordCoq{Fixpoint}}
\newcommand{\coqRequire}{\reservedWordCoq{Require}}
\newcommand{\coqImport}{\reservedWordCoq{Import}}
\newcommand{\coqModule}{\reservedWordCoq{Module}}
\newcommand{\coqEnd}{\reservedWordCoq{End}}
\newcommand{\coqTheorem}{\reservedWordCoq{Theorem}}
\newcommand{\coqProof}{\reservedWordCoq{Proof}}
\newcommand{\coqQed}{\reservedWordCoq{Qed}}

19 changes: 15 additions & 4 deletions examples/src/main/scala/soda/example/inanutshell/InANutshell.soda
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,26 @@ class MaxAndMin

end

class Pair [A : Type] [B : Type]

abstract
fst : A
snd : B

end

class MinMaxPair
extends
Pair [Int] [Int]

abstract
min : Int
max : Int

fst : Int = min

snd : Int = max

end

class Indexable
Expand All @@ -62,10 +76,7 @@ class Example
index : Int

min_max (a : Int) (b : Int) : MinMaxPair =
MinMaxPair_ (
min := MaxAndMin_ () .min (a) (b),
max := MaxAndMin_ () .max (a) (b)
)
MinMaxPair_ (min := MaxAndMin_ () .min (a) (b) ) (max := MaxAndMin_ () .max (a) (b) )

end

Expand Down
21 changes: 17 additions & 4 deletions examples/src/main/scala/soda/example/inanutshell/Package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,28 @@ trait MaxAndMin

case class MaxAndMin_ () extends MaxAndMin

trait Pair [A , B ]
{

def fst : A
def snd : B

}

case class Pair_ [A, B] (fst : A, snd : B) extends Pair [A, B]

trait MinMaxPair
extends
Pair [Int, Int]
{

def min : Int
def max : Int

lazy val fst : Int = min

lazy val snd : Int = max

}

case class MinMaxPair_ (min : Int, max : Int) extends MinMaxPair
Expand All @@ -79,10 +95,7 @@ trait Example
def index : Int

def min_max (a : Int) (b : Int) : MinMaxPair =
MinMaxPair_ (
min = MaxAndMin_ () .min (a) (b),
max = MaxAndMin_ () .max (a) (b)
)
MinMaxPair_ (min = MaxAndMin_ () .min (a) (b) , max = MaxAndMin_ () .max (a) (b) )

}

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# [https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/]
# [https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt-launch/]
#
sbt.version=1.9.6
sbt.version=1.9.7

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ package
subtype
supertype
then
theorem
this

2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This file is part of GtkSourceView
Authors: Julian Alfredo Mendez
Copyright 2020--2023 Julian Alfredo Mendez <[email protected]>
Copyright 2020-2023 Julian Alfredo Mendez <[email protected]>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -138,7 +138,6 @@
<keyword>this</keyword>
<keyword>subtype</keyword>
<keyword>supertype</keyword>
<keyword>theorem</keyword>
<keyword>directive</keyword>
</context>

Expand Down

0 comments on commit 96d9435

Please sign in to comment.