7 Commits

Author SHA1 Message Date
Jake Leahy
0bd4d80238 Allow parseAll to parse statements separated by semicolons (#23088)
Fixes the second issue listed in #9918.

Fixed by replacing the logic used in `parseAll` with just a continious
loop to `complexOrSimpleStmt` like what the [normal parser
does](https://github.com/nim-lang/Nim/blob/devel/compiler/passes.nim#L143-L146).
`complexOrSimpleStmt` [guarantees
progress](https://github.com/nim-lang/Nim/blob/devel/compiler/parser.nim#L2541)
so we don't need to check progress ourselves.

Also allows `nimpretty` to parse more valid Nim code such as 
```nim
proc foo(); # Would complain about indention here
# ...
proc foo() = 
  # ...
```
2023-12-17 09:01:00 +01:00
cooldome
7d8af25d58 revert parser stmtListExpr (#11007)
* Revert "Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)"

This reverts commit 862897dc0f.

* redo fix for #4035

* render stmtlistExpr using semicolon

* Revert "render stmtlistExpr using semicolon"

This reverts commit cafb78b8d5.

* revert test
2019-04-17 11:55:41 +02:00
cooldome
862897dc0f Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)
* Support for stmtListExpr in parser after major keywords
* fixes #4035
2019-03-18 11:09:49 +01:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Araq
10c1d7f519 minor lexer cleanups; fixes #2504 2015-04-10 14:03:48 +02:00
Araq
bc5879b9b7 fixes error propagation for macros.parseExpr 2014-11-13 09:12:27 +01:00
Araq
b2f577df23 fixes #1473 2014-11-12 02:36:59 +01:00