Permalink
Please sign in to comment.
Browse files
Several changes to prepare to optimize here doc parsing.
- Make unterminated here docs a hard error instead of a warning.
- This makes it easier for users to fix the example error in the unit
test.
- We don't check for 'EOF)', it's always 'EOF\n'.
- Document this in the manual.
- Remove a misusage of Id.Eof_Real.
- It was being used when lookahead failed. In this case,
Id.Unknown_Tok is more appropriate. Id.Eof_Real should only be used
at the actual end of a file!
- (Or it could get its own Id.Unknown_Eol.)
- Implement LineLexer.GetSpanIdForEof to show the location of EOF. This
improves error messages.
- It also caused a cascade of changes because we want to assume that
arenas are always available. The unit tests hadn't yet been updated
with this assumption.
- Now that we show EOF location information, fix the error in the here
doc test.
- Make gold tests out of some files.
- Move shell scripts that show syntax errors to their own directory.
- Fix unit test breakages caused by the last change.- Loading branch information...
Showing
with
158 additions
and 50 deletions.
- +1 −1 bin/oil.py
- +7 −0 core/alloc.py
- +10 −7 core/completion.py
- +6 −3 core/completion_test.py
- +24 −7 core/lexer.py
- +6 −2 core/shell_test.py
- +3 −2 core/state_test.py
- +10 −0 core/test_lib.py
- +23 −0 doc/osh-manual.md
- +2 −1 spec/09-here-doc.sh → gold/complex-here-docs.sh
- +22 −12 osh/cmd_parse.py
- +16 −4 osh/cmd_parse_test.py
- +6 −3 osh/lex_test.py
- +3 −3 osh/parse_lib.py
- +0 −1 osh/word_parse.py
- 0 spec/{exec-here-doc.sh → builtins-exec-here-doc-helper.sh}
- +1 −1 spec/builtins.test.sh
- 0 spec/{ → errors}/01-bad-func.sh
- 0 spec/{ → errors}/02-bad-func.sh
- 0 spec/{ → errors}/05-unterminated-single.sh
- 0 spec/{ → errors}/06-unterminated-double-long.sh
- 0 spec/{ → errors}/06-unterminated-double.sh
- 0 spec/{ → errors}/07-unterminated-here-doc-2.sh
- 0 spec/{ → errors}/07-unterminated-here-doc.sh
- 0 spec/{ → errors}/15-subshell-error.sh
- +8 −1 spec/here-doc.test.sh
- +9 −1 test/gold.sh
- +1 −1 test/spec.sh
Oops, something went wrong.
0 comments on commit
ba59db6