diff options
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/lexer.sh | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh index dc0b48d..d559274 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -86,8 +86,11 @@ next() if ${here_awaiting_end}; then synexp '' else - here_awaiting_end=false - here_awaiting_word=true + case "${here_queue}" in *"${RS}"*) + here_awaiting_end=false + here_awaiting_word=true + ;; + esac fi lgetc lineno=$((${lineno} + 1)) @@ -195,13 +198,7 @@ next_here() here_end="${here_end#*${US}}" here_escaped="${here##*${US}}" here_queue="${here_queue#*${RS}}" - case "${here_queue}" in - *"${RS}"*) - ;; - *) - here_awaiting_word=false - ;; - esac + here_awaiting_word=false line='' word='' @@ -217,14 +214,13 @@ next_here() "${here_end}" ;; "${LF}") - line="${line}${c}" word="${word}${line}" - case "${line}" in "${here_end}${LF}") - lgetc + case "${line}" in "${here_end}") tok="T_WORD${US}${word}" return ;; esac + word="${word}${c}" line='' ;; "${HT}") |