Skip to content

Commit 4ec4597

Browse files
authored
Merge PR #12: Fix parsing of #- symbol
2 parents 5f6d7a7 + eb78e68 commit 4ec4597

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
10+
- uses: actions/checkout@v3
11+
1212
- name: Use Node.js
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v3
1414

1515
- run: ./som.sh -cp core-lib/Smalltalk core-lib/TestSuite/TestHarness.som
1616
- run: ./som.sh -cp core-lib/Smalltalk:core-lib/TestSuite:core-lib/SomSom/src/compiler:core-lib/SomSom/src/vm:core-lib/SomSom/src/vmobjects:core-lib/SomSom/src/interpreter:core-lib/SomSom/src/primitives core-lib/SomSom/tests/SomSomTests.som

rebench.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
benchmark_suites:
1919
macro:
2020
gauge_adapter: RebenchLog
21-
command: &MACRO_CMD "-cp Smalltalk:Examples/Benchmarks/Richards:Examples/Benchmarks/DeltaBlue:Examples/Benchmarks/NBody:Examples/Benchmarks/Json:Examples/Benchmarks/GraphSearch Examples/Benchmarks/BenchmarkHarness.som %(benchmark)s %(iterations)s 0 "
21+
command: &MACRO_CMD "-cp Smalltalk:Examples/Benchmarks/Richards:Examples/Benchmarks/DeltaBlue:Examples/Benchmarks/NBody:Examples/Benchmarks/Json:Examples/Benchmarks/GraphSearch Examples/Benchmarks/BenchmarkHarness.som %(benchmark)s %(iterations)s "
2222
iterations: 10
2323
benchmarks:
2424
- Richards: {extra_args: 1}
@@ -30,7 +30,7 @@ benchmark_suites:
3030

3131
micro:
3232
gauge_adapter: RebenchLog
33-
command: "-cp Smalltalk:Examples/Benchmarks/LanguageFeatures Examples/Benchmarks/BenchmarkHarness.som %(benchmark)s %(iterations)s 0 "
33+
command: "-cp Smalltalk:Examples/Benchmarks/LanguageFeatures Examples/Benchmarks/BenchmarkHarness.som %(benchmark)s %(iterations)s "
3434
iterations: 10
3535
benchmarks:
3636
- Fannkuch: {extra_args: 6}
@@ -56,7 +56,7 @@ benchmark_suites:
5656

5757
executors:
5858
som: {path: ., executable: som.sh}
59-
59+
6060
# define the benchmarks to be executed for a re-executable benchmark run
6161
experiments:
6262
JsSOM:

src/som/compiler/Parser.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ParseErrorWithSymbolList extends ParseError {
9696

9797
const singleOpSyms = [Sym.Not, Sym.And, Sym.Or, Sym.Star, Sym.Div,
9898
Sym.Mod, Sym.Plus, Sym.Equal, Sym.More, Sym.Less,
99-
Sym.Comma, Sym.At, Sym.Per, Sym.NONE];
99+
Sym.Comma, Sym.At, Sym.Per, Sym.Minus, Sym.NONE];
100100

101101
const binaryOpSyms = [Sym.Or, Sym.Comma, Sym.Minus, Sym.Equal, Sym.Not,
102102
Sym.And, Sym.Or, Sym.Star, Sym.Div, Sym.Mod,
@@ -331,11 +331,7 @@ export class Parser {
331331
binarySelector() {
332332
const s = this.text;
333333

334-
if (this.accept(Sym.Or)) { /* noop */
335-
} else if (this.accept(Sym.Comma)) { /* noop */
336-
} else if (this.accept(Sym.Minus)) { /* noop */
337-
} else if (this.accept(Sym.Equal)) { /* noop */
338-
} else if (this.acceptOneOf(singleOpSyms)) { /* noop */
334+
if (this.acceptOneOf(singleOpSyms)) { /* noop */
339335
} else if (this.accept(Sym.OperatorSequence)) { /* noop */
340336
} else { this.expect(Sym.NONE); }
341337

0 commit comments

Comments
 (0)