diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index 9bce8934..7f679aa3 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -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 diff --git a/documentation/src/site/tex/common/language.tex b/documentation/src/site/tex/common/language.tex index 919855c4..ab1f2fc3 100644 --- a/documentation/src/site/tex/common/language.tex +++ b/documentation/src/site/tex/common/language.tex @@ -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]" @@ -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}} @@ -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}} - diff --git a/examples/src/main/scala/soda/example/inanutshell/InANutshell.soda b/examples/src/main/scala/soda/example/inanutshell/InANutshell.soda index c1bac66b..08821c37 100644 --- a/examples/src/main/scala/soda/example/inanutshell/InANutshell.soda +++ b/examples/src/main/scala/soda/example/inanutshell/InANutshell.soda @@ -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 @@ -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 diff --git a/examples/src/main/scala/soda/example/inanutshell/Package.scala b/examples/src/main/scala/soda/example/inanutshell/Package.scala index 7ea80d76..082221fa 100644 --- a/examples/src/main/scala/soda/example/inanutshell/Package.scala +++ b/examples/src/main/scala/soda/example/inanutshell/Package.scala @@ -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 @@ -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) ) } diff --git a/project/build.properties b/project/build.properties index 41871712..28a421f8 100644 --- a/project/build.properties +++ b/project/build.properties @@ -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 diff --git a/translator/src/main/resources/soda/translator/documentation/configuration_for_intellij.txt b/translator/src/main/resources/soda/translator/documentation/configuration_for_intellij.txt index 4ede2308..b4b31d94 100644 --- a/translator/src/main/resources/soda/translator/documentation/configuration_for_intellij.txt +++ b/translator/src/main/resources/soda/translator/documentation/configuration_for_intellij.txt @@ -46,7 +46,6 @@ package subtype supertype then -theorem this 2 diff --git a/translator/src/main/resources/soda/translator/documentation/soda.lang b/translator/src/main/resources/soda/translator/documentation/soda.lang index 7f13b5e1..0ff2cd71 100644 --- a/translator/src/main/resources/soda/translator/documentation/soda.lang +++ b/translator/src/main/resources/soda/translator/documentation/soda.lang @@ -4,7 +4,7 @@ This file is part of GtkSourceView Authors: Julian Alfredo Mendez - Copyright 2020--2023 Julian Alfredo Mendez + Copyright 2020-2023 Julian Alfredo Mendez GtkSourceView is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -138,7 +138,6 @@ this subtype supertype - theorem directive