diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2017-05-07 17:01:49 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2017-05-07 17:01:49 +0300 |
commit | 8087a503f00913fc7b26e75d9549f6b99adf3242 (patch) | |
tree | 8e6a4c84c2fa3e518f4ae173ff5d6a186f0fd9d7 /src/ragel | |
parent | 92f1dbb651217ea062d81237c6e72eaa257c6b81 (diff) |
ragel.rl: Make search_err read "p" before stop
If we stop before reading the "p" false positive may be returned since
"p" may be the start of new token.
Thus case like `type: 3u8[4] str;` would fail to mark the real error
since '3' is not read. Thus start marking from the last valid token
that is ':'.
Diffstat (limited to 'src/ragel')
-rw-r--r-- | src/ragel/ragel.rl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ragel/ragel.rl b/src/ragel/ragel.rl index 48c4229..655bb9c 100644 --- a/src/ragel/ragel.rl +++ b/src/ragel/ragel.rl @@ -20,7 +20,7 @@ word = alnum*; token = ' ' | punct; until_err = (any when { fpc != *error })*; - search_err := ((any | token %{ *error = fpc; }) when { fpc != ragel->p })*; + search_err := ((any | token %{ *error = fpc; }) when { fpc != ragel->pe && fpc <= ragel->p })*; print_err := (until_err %red <: word %reset <: (any - '\n')*) ${ fputc(fc, stderr); } >lead %!end %/end; print_mark := (until_err ${ fputc(' ', stderr); } %red %mark <: any word $tail) >lead %!end %/end; }%% |