File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3402,6 +3402,7 @@ function parse_atom(ps::ParseState, check_identifiers=true)
34023402 if k == K " '"
34033403 # '' ==> (char (error))
34043404 bump_invisible (ps, K " error" , error= " empty character literal" )
3405+ bump (ps, TRIVIA_FLAG)
34053406 elseif k == K " EndMarker"
34063407 # ' ==> (char (error))
34073408 bump_invisible (ps, K " error" , error= " unterminated character literal" )
Original file line number Diff line number Diff line change @@ -990,15 +990,19 @@ parsestmt_test_specs = [
990990 " x in'c'" => " (call-i x in (char 'c'))"
991991 " 1where'c'" => " (where 1 (char 'c'))"
992992 " :+'y'" => " (juxtapose (call-post (quote-: +) ') (call-post y '))"
993+ # Empty character consumes trailing ' delimiter (ideally this could be
994+ # tested above but we don't require the input stream to be consumed in the
995+ # unit tests there.
996+ " ''" => " (char (error))"
993997
994998 # The following may not be ideal error recovery! But at least the parser
995999 # shouldn't crash
9961000 " @(x y)" => " (macrocall (parens @x (error-t y)))"
9971001 " |(&\n function" => " (call | (& (function (error (error)) (block (error)) (error-t))) (error-t))"
9981002
999- # The following are currently broken but at least the parser shouldn't
1003+ # The following is currently broken but at least the parser shouldn't
10001004 # crash.
1001- " x in' '" => " (wrapper ( call-i x in (char (error))) (error-t ' ))"
1005+ " x in' '" => " (call-i x in (char (error)))"
10021006]
10031007
10041008@testset " Parser does not crash on broken code" begin
You can’t perform that action at this time.
0 commit comments