mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
* #40 grammar: don't require EOL after blocks, so .p8 files need not end with that
This commit is contained in:
parent
f2844bdf1a
commit
b8117394c0
@ -45,8 +45,6 @@ class ModuleImporter(private val program: Program,
|
||||
throw ParsingFailedError("No such file: $filePath")
|
||||
|
||||
var content = filePath.toFile().readText().replace("\r\n", "\n") // normalize line endings
|
||||
if(content.last()!='\n')
|
||||
content+='\n' // grammar requires blocks (and thus module files) to end in an EOL
|
||||
|
||||
return importModule(CharStreams.fromString(content), filePath, false)
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ register: 'A' | 'X' | 'Y' | 'AX' | 'AY' | 'XY' | 'Pc' | 'Pz' | 'Pn' | 'Pv' | 'R0
|
||||
|
||||
module : (directive | block | EOL)* EOF ;
|
||||
|
||||
block: identifier integerliteral? '{' EOL (block_statement | EOL) * '}' EOL ;
|
||||
block: identifier integerliteral? '{' EOL (block_statement | EOL) * '}' (EOL | EOF) ;
|
||||
|
||||
|
||||
block_statement:
|
||||
|
Loading…
x
Reference in New Issue
Block a user