mirror of
https://github.com/AppleCommander/bastools.git
synced 2024-09-28 19:54:25 +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))
|
ApplesoftKeyword.find(String.format("%c", tokenizer.ttype))
|
||||||
.map(kw -> Token.keyword(line, kw))
|
.map(kw -> Token.keyword(line, kw))
|
||||||
.orElse(Token.syntax(line, tokenizer.ttype)));
|
.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:
|
default:
|
||||||
throw new IOException(String.format(
|
throw new IOException(String.format(
|
||||||
"Unknown! ttype=%d, nval=%f, sval=%s\n", tokenizer.ttype, tokenizer.nval, tokenizer.sval));
|
"Unknown! ttype=%d, nval=%f, sval=%s\n", tokenizer.ttype, tokenizer.nval, tokenizer.sval));
|
||||||
|
Loading…
Reference in New Issue
Block a user