Skip to content

Commit 55ada77

Browse files
committed
Merge pull request #869 from summivox/fix-fix-859
fix a typo in #859 (overlooked due to insufficient coverage)
2 parents 18e3e72 + c7eed67 commit 55ada77

File tree

5 files changed

+103
-26
lines changed

5 files changed

+103
-26
lines changed

lib/ast.js

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/grammar.js

Lines changed: 33 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/parser.js

Lines changed: 53 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/grammar.ls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ bnf =
422422
o 'FOR ID FROM Expression TO Expression BY Expression'
423423
, -> new For kind: $1, index: $2, from: $4, op: $5, to: $6, step: $8
424424
o 'FOR FROM Expression TO Expression BY Expression'
425-
, -> new For kind: $1, from: $3, op: $4, to: $5, step: $6, ref: true
425+
, -> new For kind: $1, from: $3, op: $4, to: $5, step: $7, ref: true
426426
o 'FOR ID FROM Expression TO Expression BY Expression CASE Expression'
427427
, -> new For kind: $1, index: $2, from: $4, op: $5, to: $6, step: $8, guard: $10
428428
o 'FOR FROM Expression TO Expression BY Expression CASE Expression'

test/loop.ls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ deep-equal [3,4,5] [.. + 2 for [1 2 3]]
295295
deep-equal [3,5] [.. + 2 for [1 2 3] when .. % 2 isnt 0]
296296
deep-equal [5,4,3] [.. + 2 for [1 2 3] by -1]
297297
deep-equal [5,3] [.. + 2 for [1 2 3] by -1 when .. % 2 isnt 0]
298+
deep-equal [3,4,5] [.. + 2 for from 1 to 3]
299+
deep-equal [3,5] [.. + 2 for from 1 to 3 when .. % 2 isnt 0]
300+
deep-equal [5,4,3] [.. + 2 for from 3 to 1 by -1]
298301
deep-equal [5,3] [.. + 2 for from 3 to 1 by -1 when .. % 2 isnt 0]
299302

300303
list-of-obj =

0 commit comments

Comments
 (0)