Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6f03a59
Bump javacc from 7.0.5 to 7.0.10
dependabot[bot] Mar 1, 2022
afe1a32
Bump junit-jupiter.version from 5.7.2 to 5.8.2
dependabot[bot] Mar 1, 2022
7a70a1d
Bump slf4j-api from 1.7.25 to 1.7.36
dependabot[bot] Mar 1, 2022
f4d744f
[MOREL-105] Allow identifiers to contain prime characters (')
julianhyde Mar 1, 2022
da15b9f
Bump jsr305 from 1.3.9 to 3.0.2
dependabot[bot] Mar 1, 2022
e5c91b4
Bump maven-surefire-plugin from 3.0.0-M3 to 3.0.0-M5
dependabot[bot] Mar 1, 2022
588a23c
Bump maven-site-plugin from 3.7.1 to 3.11.0
dependabot[bot] Mar 1, 2022
b535bf6
Bump jline from 3.16.0 to 3.21.0
dependabot[bot] Mar 1, 2022
8073a6d
Bump guava from 21.0 to 23.0
dependabot[bot] Mar 1, 2022
47249da
Test Guava versions 19.0 to 31.1-jre in CI
julianhyde Mar 1, 2022
51804d4
Bump javacc-maven-plugin from 3.0.0 to 3.0.3
dependabot[bot] Mar 2, 2022
6453be4
Bump maven-javadoc-plugin from 3.0.1 to 3.3.2
dependabot[bot] Mar 2, 2022
af5036b
Bump maven-enforcer-plugin from 3.0.0-M1 to 3.0.0
dependabot[bot] Mar 3, 2022
7f4ea96
Bump maven-project-info-reports-plugin from 2.9 to 3.2.2
dependabot[bot] Mar 3, 2022
2a34f20
Bump hsqldb from 2.3.1 to 2.5.1, foodmart-data-hsqldb from 0.4 to 0.5…
julianhyde Mar 9, 2022
37b0387
Turn off Travis CI
julianhyde Mar 13, 2022
2d7b347
Make ShellTest more robust
julianhyde Mar 13, 2022
21c6fef
[MOREL-118] Report positions in error messages and exceptions
julianhyde Mar 2, 2022
e102684
Satisfiability prover
julianhyde Mar 18, 2022
5a7d248
[MOREL-55] Analyze match coverage, detecting redundant and exhaustive…
julianhyde Mar 19, 2022
49bc3c3
Bump calcite-core from 1.29.0 to 1.30.0
dependabot[bot] Mar 24, 2022
b7e3881
Bump checkstyle from 7.8.2 to 9.3 and maven-checkstyle-plugin from 3.…
julianhyde Mar 25, 2022
9aecee4
Bump maven-source-plugin from 2.2.1 to 3.2.1
dependabot[bot] Mar 25, 2022
9117375
Bump maven-compiler-plugin from 2.3.2 to 3.10.1
dependabot[bot] Mar 25, 2022
a56205c
Bump build-helper-maven-plugin from 1.9 to 3.3.0
dependabot[bot] Mar 25, 2022
8f772e4
Bump git-commit-id-plugin from 2.1.9 to 4.9.10
dependabot[bot] Mar 25, 2022
aeb1050
Bump maven-surefire-plugin from 3.0.0-M5 to 3.0.0-M6
dependabot[bot] Apr 4, 2022
95e81ed
[MOREL-138] Type annotations in patterns, function declarations and e…
julianhyde Apr 6, 2022
2ea5380
Bump javacc from 7.0.10 to 7.0.11
dependabot[bot] Apr 20, 2022
b10a613
Bump maven-site-plugin from 3.11.0 to 3.12.0
dependabot[bot] Apr 21, 2022
339f7d5
Bump maven-javadoc-plugin from 3.3.2 to 3.4.0
dependabot[bot] Apr 21, 2022
21031ef
Bump checkstyle from 9.3 to 10.2
dependabot[bot] Apr 25, 2022
44a8f3e
Default to Checkstyle version 10.2 and Guava 31.1-jre
julianhyde Apr 25, 2022
a328fbe
Bump maven-project-info-reports-plugin from 3.2.2 to 3.3.0
dependabot[bot] Apr 28, 2022
6040e55
Initial programmatic shell buildout
GavinRay97 May 14, 2022
7722b2f
Initial working implementation
GavinRay97 May 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,31 @@ jobs:

strategy:
matrix:
java-version: [ 8, 11, 17 ]
java-version: [ "11" ]
guava-version: [ "" ]
checkstyle-version: [ "" ]
javadoc: [ false ]
include:
- java-version: 17
- java-version: "8"
guava-version: "19.0"
checkstyle-version: "9.3"
javadoc: false
- java-version: "17"
guava-version: "23.0"
javadoc: true
- java-version: "17"
guava-version: "31.1-jre"
javadoc: false
checkstyle-version: ""
- java-version: "18"
javadoc: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
Expand All @@ -47,6 +60,15 @@ jobs:
then
GOALS="$GOALS javadoc:javadoc javadoc:test-javadoc"
fi
mvn -Dmorel.ci --batch-mode --update-snapshots $GOALS
DEFS="-Dmorel.ci"
if [ "${{ matrix.checkstyle-version }}" ]
then
DEFS="$DEFS -Dcheckstyle.version=${{ matrix.checkstyle-version }}"
fi
if [ "${{ matrix.guava-version }}" ]
then
DEFS="$DEFS -Dguava.version=${{ matrix.guava-version }}"
fi
mvn $DEFS --batch-mode --update-snapshots $GOALS

# End main.yml
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ until version 0.2.)

## Requirements

Java version 8 or higher.
Java version 11 or higher.

## Get Morel

Expand Down Expand Up @@ -61,6 +61,8 @@ On Windows, the last line is
> mvnw install
```

If you are using Java 8, you should add parameters `-Dcheckstyle.version=9.3`.

### Run the shell

```bash
Expand Down
26 changes: 14 additions & 12 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ In Morel but not Standard ML:
In Standard ML but not in Morel:
* `word` constant
* `longid` identifier
* type annotations ("`:` *typ*") (appears in expressions, patterns, and *funmatch*)
* references (`ref` and operators `!` and `:=`)
* exceptions (`raise`, `handle`, `exception`)
* `while` loop
Expand Down Expand Up @@ -131,6 +130,7 @@ In Standard ML but not in Morel:
| '<b>(</b>' <i>exp<sub>1</sub></i> <b>;</b> ... <b>;</b> <i>exp<sub>n</sub></i> '<b>)</b>' sequence (n &ge; 2)
| <b>let</b> <i>dec</i> <b>in</b> <i>exp<sub>1</sub></i> ; ... ; <i>exp<sub>n</sub></i> <b>end</b>
local declaration (n ≥ 1)
| <i>exp</i> <b>:</b> <i>type</i> type annotation
| <i>exp<sub>1</sub></i> <b>andalso</b> <i>exp<sub>2</sub></i> conjunction
| <i>exp<sub>1</sub></i> <b>orelse</b> <i>exp<sub>2</sub></i> disjunction
| <b>if</b> <i>exp<sub>1</sub></i> <b>then</b> <i>exp<sub>2</sub></i> <b>else</b> <i>exp<sub>3</sub></i>
Expand Down Expand Up @@ -173,6 +173,7 @@ In Standard ML but not in Morel:
| '<b>(</b>' <i>pat<sub>1</sub></i> , ... , <i>pat<sub>n</sub></i> '<b>)</b>' tuple (n &ne; 1)
| <b>{</b> [ <i>patrow</i> ] <b>}</b> record
| '<b>[</b>' <i>pat<sub>1</sub></i> <b>,</b> ... <b>,</b> <i>pat<sub>n</sub></i> '<b>]</b>' list (n &ge; 0)
| <i>pat</i> <b>:</b> <i>type</i> type annotation
| <i>id</i> <b>as</b> <i>pat</i> layered
<i>patrow</i> &rarr; '<b>...</b>' wildcard
| <i>lab</i> <b>=</b> <i>pat</i> [<b>,</b> <i>patrow</i>] pattern
Expand Down Expand Up @@ -206,10 +207,10 @@ In Standard ML but not in Morel:
<i>funbind</i> &rarr; <i>funmatch</i> [ <b>and</b> <i>funmatch</i> ]*
clausal function
<i>funmatch</i> &rarr; <i>funmatchItem</i> [ '<b>|</b>' funmatchItem ]*
<i>funmatchItem</i> &rarr; [ <b>op</b> ] <i>id</i> <i>pat<sub>1</sub></i> ... <i>pat<sub>n</sub></i> <b>=</b> <i>exp</i>
<i>funmatchItem</i> &rarr; [ <b>op</b> ] <i>id</i> <i>pat<sub>1</sub></i> ... <i>pat<sub>n</sub></i> [ <b>:</b> <i>type</i> ] <b>=</b> <i>exp</i>
nonfix (n &ge; 1)
| <i>pat<sub>1</sub></i> <i>id</i> <i>pat<sub>2</sub></i> <b>=</b> <i>exp</i> infix
| '<b>(</b>' <i>pat<sub>1</sub></i> <i>id</i> <i>pat<sub>2</sub></i> '<b>)</b>' <i>pat'<sub>1</sub></i> ... <i>pat'<sub>n</sub></i> = <i>exp</i>
| <i>pat<sub>1</sub></i> <i>id</i> <i>pat<sub>2</sub></i> [ <b>:</b> <i>type</i> ] <b>=</b> <i>exp</i> infix
| '<b>(</b>' <i>pat<sub>1</sub></i> <i>id</i> <i>pat<sub>2</sub></i> '<b>)</b>' <i>pat'<sub>1</sub></i> ... <i>pat'<sub>n</sub></i> [ <b>:</b> <i>type</i> ] = <i>exp</i>
infix (n &ge; 0)
<i>datbind</i> &rarr; <i>datbindItem</i> [ <b>and</b> <i>datbindItem</i> ]*
data type
Expand Down Expand Up @@ -470,11 +471,12 @@ Each property is set using the function `Sys.set (name, value)`,
displayed using `Sys.show name`,
and unset using `Sys.unset name`.

| Name | Type | Default | Description |
| ---------------- | ---- | ------- | ----------- |
| hybrid | bool | false | Whether to try to create a hybrid execution plan that uses Apache Calcite relational algebra. |
| inlinePassCount | int | 5 | Maximum number of inlining passes. |
| lineWidth | int | 79 | When printing, the length at which lines are wrapped. |
| printDepth | int | 5 | When printing, the depth of nesting of recursive data structure at which ellipsis begins. |
| printLength | int | 12 | When printing, the length of lists at which ellipsis begins. |
| stringDepth | int | 70 | When printing, the length of strings at which ellipsis begins. |
| Name | Type | Default | Description |
| -------------------- | ---- | ------- | ----------- |
| hybrid | bool | false | Whether to try to create a hybrid execution plan that uses Apache Calcite relational algebra. |
| inlinePassCount | int | 5 | Maximum number of inlining passes. |
| lineWidth | int | 79 | When printing, the length at which lines are wrapped. |
| matchCoverageEnabled | bool | true | Whether to check whether patterns are exhaustive and/or redundant. |
| printDepth | int | 5 | When printing, the depth of nesting of recursive data structure at which ellipsis begins. |
| printLength | int | 12 | When printing, the length of lists at which ellipsis begins. |
| stringDepth | int | 70 | When printing, the length of strings at which ellipsis begins. |
61 changes: 30 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,34 @@ License.
<top.dir>${project.basedir}</top.dir>

<!-- Component and plugin versions, in alphabetical order. -->
<calcite.version>1.29.0</calcite.version>
<checkstyle.version>7.8.2</checkstyle.version>
<findbugs.version>1.3.9</findbugs.version>
<foodmart-data-hsqldb.version>0.4</foodmart-data-hsqldb.version>
<!-- We support guava versions 19.0 to 27.1-jre. -->
<guava.version>21.0</guava.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<calcite.version>1.30.0</calcite.version>
<!-- We support (and test) Checkstyle as low as 9.3.
In JDK 8, you must add '-Dcheckstyle.version=9.3' because
Checkstyle 10 requires JDK 11 or higher. -->
<checkstyle.version>10.2</checkstyle.version>
<findbugs.version>3.0.2</findbugs.version>
<foodmart-data-hsqldb.version>0.5</foodmart-data-hsqldb.version>
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
<!-- We support (and test) Guava as low as 19. -->
<guava.version>31.1-jre</guava.version>
<hamcrest.version>2.2</hamcrest.version>
<hsqldb.version>2.3.1</hsqldb.version>
<hydromatic-toolbox.version>0.3</hydromatic-toolbox.version>
<hsqldb.version>2.5.1</hsqldb.version>
<java-diff.version>1.1.2</java-diff.version>
<javacc-maven-plugin.version>3.0.0</javacc-maven-plugin.version>
<javacc.version>7.0.5</javacc.version>
<jline.version>3.16.0</jline.version>
<junit-jupiter.version>5.7.2</junit-jupiter.version>
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>
<maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
<scott-data-hsqldb.version>0.1</scott-data-hsqldb.version>
<slf4j.version>1.7.25</slf4j.version>
<javacc-maven-plugin.version>3.0.3</javacc-maven-plugin.version>
<javacc.version>7.0.11</javacc.version>
<jline.version>3.21.0</jline.version>
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
<maven-project-info-reports-plugin.version>3.3.0</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.12.0</maven-site-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>3.0.0-M6</maven-surefire-plugin.version>
<scott-data-hsqldb.version>0.2</scott-data-hsqldb.version>
<slf4j.version>1.7.36</slf4j.version>

<maven-javadoc-plugin.additionalOptions>-html5</maven-javadoc-plugin.additionalOptions>
<maven-javadoc-plugin.excludePackageNames>net.hydromatic.morel.parse</maven-javadoc-plugin.excludePackageNames>
Expand Down Expand Up @@ -234,6 +240,7 @@ License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -248,6 +255,7 @@ License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>8</source>
<target>8</target>
Expand Down Expand Up @@ -280,17 +288,6 @@ License.
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>net.hydromatic</groupId>
<artifactId>toolbox</artifactId>
<version>${hydromatic-toolbox.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
<plugin>
Expand Down Expand Up @@ -335,6 +332,7 @@ License.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<!-- Make sure every sub-project has LICENSE, NOTICE and
git.properties in its jar's META-INF directory. -->
<executions>
Expand Down Expand Up @@ -397,6 +395,7 @@ License.
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<inherited>false</inherited>
<executions>
<execution>
Expand Down
64 changes: 29 additions & 35 deletions src/main/config/checkstyle/checker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ License.
<!-- No tabs allowed! -->
<module name="FileTabCharacter"/>

<module name="TreeWalker">
<property name="cacheFile" value="target/checkstyle-cachefile"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- Lines cannot exceed 80 chars, except if they are hyperlinks
or strings (possibly preceded by '+' or '*' and followed by
say '),'. We allow leeway up to 85 chars.-->
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="85"/>
<property name="ignorePattern" value="^import|@see|@link|@BaseMessage|href|^[ +*]*&quot;.*&quot;[);,]*$"/>
</module>

<module name="TreeWalker">
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!-- No empty blocks (i.e. catch); must contain at least a comment -->
Expand Down Expand Up @@ -126,8 +135,10 @@ License.
</module>
<module name="ImportOrder">
<property name="groups" value="net.hydromatic.morel,*,/^javax?/"/>
<property name="staticGroups" value="net.hydromatic.morel,*,/^javax?/"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="separatedStaticGroups" value="true"/>
<property name="option" value="bottom"/>
</module>

Expand All @@ -150,9 +161,6 @@ License.
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
</module>
<!-- Turn this on to see what needs to be done
<module name="TodoComment"/>
-->
<module name="UpperEll"/>

<module name="OperatorWrap"/>
Expand Down Expand Up @@ -220,15 +228,6 @@ License.
<property name="message" value="C-style comment"/>
</module>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- Lines cannot exceed 80 chars, except if they are hyperlinks
or strings (possibly preceded by '+' and followed by say '),'. -->
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^import|@see|@link|@BaseMessage|href|^[ +]*&quot;.*&quot;[);,]*$"/>
</module>

<module name="MethodLength">
<property name="max" value="250"/>
</module>
Expand Down Expand Up @@ -256,28 +255,23 @@ License.
<!-- No extra whitespace around types -->
<module name="GenericWhitespace"/>

<!-- Required for SuppressionCommentFilter below -->
<module name="FileContentsHolder"/>
</module>

<!-- Setup special comments to suppress specific checks from source files -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<!-- Setup special comments to suppress specific checks from source files -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>

<!-- Turn off all checks between OFF and ON -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE\: ON"/>
</module>
<!-- Turn off all checks between OFF and ON -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE\: ON"/>
</module>

<!-- Turn off checks for the next N lines. -->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE: +IGNORE (\d+)"/>
<property name="influenceFormat" value="$1"/>
<!-- Turn off checks for the next N lines. -->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE: +IGNORE (\d+)"/>
<property name="influenceFormat" value="$1"/>
</module>
</module>

<module name="net.hydromatic.toolbox.checkstyle.HydromaticFileSetCheck"/>
</module>
Loading