From: NeilBrown Date: Mon, 19 Feb 2018 06:47:00 +0000 (+1100) Subject: scanner: capture the tail of a string. X-Git-Tag: StoneyCreek~1 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=3ff33c4eecc9cce64827d52172c85123faac8b1c scanner: capture the tail of a string. A string can have a tail, "hello"xy where the "xy" might one day have a meaning (utf8? utf16??). We should capture that. Signed-off-by: NeilBrown --- diff --git a/csrc/scanner.mdc b/csrc/scanner.mdc index a5eeb1f..0d7a62d 100644 --- a/csrc/scanner.mdc +++ b/csrc/scanner.mdc @@ -520,6 +520,10 @@ If `TK_string` is ignored, then quote characters will appear as `TK_mark`s. break; } } + while (!at_eon(state) && (ch = get_char(state)) && + iswalpha(ch)) + ; + unget_char(state); close_token(state, &tk); return tk; }