diff --git a/readme.txt b/readme.txt index 29c8926..3e9c5f7 100644 --- a/readme.txt +++ b/readme.txt @@ -45,6 +45,10 @@ Release notes: 1c/03, Lib 1.2.4: + Compiler: Patched over a bug with non-ASCII word separators. + The problem isn't really fixed, but it will no longer corrupt + your game text. + Unit test runner: (game over) and (game over $) are now overridden in unit.dg, to enable testing of win conditions. diff --git a/src/parse.c b/src/parse.c index 967b594..55ee3cf 100644 --- a/src/parse.c +++ b/src/parse.c @@ -368,7 +368,7 @@ static int next_token(struct lexer *lexer, int parsemode) { return 0; } } - if(strchr(STOPCHARS, ch)) { + if(ch < 0x80 && strchr(STOPCHARS, ch)) { // TODO - need to recognize high stopchars here ideally buf[0] = ch; buf[1] = 0; lexer->kind = TOK_BAREWORD; @@ -431,7 +431,7 @@ static int next_token(struct lexer *lexer, int parsemode) { lexer->errorflag = 1; return 0; } - if(strchr(STOPCHARS, ch)) { + if(ch < 0x80 && strchr(STOPCHARS, ch)) { // TODO - and here (see above) if(parsemode == PMODE_VALUE) { report(LVL_ERR, line, "Stop-character \"%c\" cannot appear inside a multi-character dictionary word.", @@ -448,7 +448,7 @@ static int next_token(struct lexer *lexer, int parsemode) { break; } } - if(strchr(STOPCHARS, ch)) { + if(ch < 0x80 && strchr(STOPCHARS, ch)) { // TODO - and here if(parsemode == PMODE_VALUE) { report(LVL_ERR, line, "Stop-character \"%c\" cannot appear inside a multi-character dictionary word.",