Skip to content

Commit e57b800

Browse files
authored
More fuzz testing tools and fixes (#188)
* Line-deletion based fuzzer * Token-deletion based fuzzer * Fixes for two crashing bugs found this way - `"(y::\nif x z end)"` - `"@(x y)"`
1 parent f2452c4 commit e57b800

File tree

3 files changed

+1074
-60
lines changed

3 files changed

+1074
-60
lines changed

src/parser.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,7 @@ function parse_resword(ps::ParseState)
17781778
# In normal_context
17791779
# begin f() where T = x end ==> (block (= (where (call f) T) x))
17801780
ps = normal_context(ps)
1781+
bump_trivia(ps)
17811782
mark = position(ps)
17821783
word = peek(ps)
17831784
if word in KSet"begin quote"
@@ -2335,7 +2336,7 @@ function fix_macro_name_kind!(ps::ParseState, macro_name_position, name_kind=not
23352336
# TODO: Clean this up when K"parens" is implemented
23362337
while true
23372338
macro_name_position = ParseStreamPosition(macro_name_position.token_index-1,
2338-
macro_name_position.range_index)
2339+
macro_name_position.range_index-1)
23392340
b = peek_behind(ps, macro_name_position)
23402341
k = b.kind
23412342
if !has_flags(b.flags, TRIVIA_FLAG)

0 commit comments

Comments
 (0)