mirror of
https://github.com/AppleCommander/bastools.git
synced 2025-03-10 20:37:37 +00:00
Allowing a line continuation character of "\" with a newline immediately
after the "\" character.
This commit is contained in:
parent
070b9371ec
commit
b84896c8cf
@ -145,6 +145,13 @@ public class TokenReader {
|
||||
ApplesoftKeyword.find(String.format("%c", tokenizer.ttype))
|
||||
.map(kw -> Token.keyword(line, kw))
|
||||
.orElse(Token.syntax(line, tokenizer.ttype)));
|
||||
case '\\':
|
||||
// Special case: introducing a backslash to ignore the IMMEDIATELY following EOL
|
||||
// If this does not occur, we simply fall through and fail. That is intentional!
|
||||
if (tokenizer.nextToken() == StreamTokenizer.TT_EOL) {
|
||||
// Consume the EOL and continue on our merry way
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new IOException(String.format(
|
||||
"Unknown! ttype=%d, nval=%f, sval=%s\n", tokenizer.ttype, tokenizer.nval, tokenizer.sval));
|
||||
|
Loading…
x
Reference in New Issue
Block a user