@@ -398,7 +398,7 @@ function parse_Nary(ps::ParseState, down, delimiters, closing_tokens)
398398 break
399399 elseif k in delimiters
400400 # ignore empty delimited sections
401- # a;;;b ==> (block a b)
401+ # a;;;b ==> (block a b)
402402 continue
403403 end
404404 down (ps)
@@ -433,7 +433,7 @@ function parse_toplevel(ps::ParseState)
433433 nothing
434434end
435435
436- # Parse a newline or semicolon-delimited list of expressions.
436+ # Parse a newline or semicolon-delimited list of expressions.
437437# Repeated delimiters are allowed but ignored
438438# a;b;c ==> (block a b c)
439439# a;;;b;; ==> (block a b)
@@ -2246,7 +2246,7 @@ function parse_imports(ps::ParseState)
22462246 bump (ps, TRIVIA_FLAG)
22472247 emark = position (ps)
22482248 initial_as = parse_import (ps, word, false )
2249- t = peek_token (ps)
2249+ t = peek_token (ps)
22502250 k = kind (t)
22512251 has_import_prefix = false # true if we have `prefix:` in `import prefix: stuff`
22522252 has_comma = false
@@ -2798,7 +2798,7 @@ function parse_cat(ps::ParseState, closer, end_is_symbol)
27982798 if k == K " ," || (is_closing_token (ps, k) && k != K " ;" )
27992799 if k == K " ,"
28002800 # [x,] ==> (vect x)
2801- bump (ps, TRIVIA_FLAG)
2801+ bump (ps, TRIVIA_FLAG; skip_newlines = true )
28022802 end
28032803 # [x] ==> (vect x)
28042804 # [x \n ] ==> (vect x)
@@ -2912,9 +2912,9 @@ end
29122912# For example, (a=1; b=2) could be seen to parse four different ways!
29132913#
29142914# Function args: (kw a 1) (parameters (kw b 2))
2915- # Tuple-like: (= a 1) (parameters (kw b 2))
2916- # Block: (= a 1) (= b 2)
2917- # [] vect-like: (= a 1) (parameters (= b 2))
2915+ # Tuple-like: (= a 1) (parameters (kw b 2))
2916+ # Block: (= a 1) (= b 2)
2917+ # [] vect-like: (= a 1) (parameters (= b 2))
29182918#
29192919# Expressions (X; Y; Z) with more semicolons are also allowed by the flisp
29202920# parser and generally parse as nested parameters blocks. This is invalid Julia
@@ -3384,7 +3384,7 @@ function parse_atom(ps::ParseState, check_identifiers=true)
33843384 # 42 ==> 42
33853385 bump (ps)
33863386 elseif is_closing_token (ps, leading_kind)
3387- # Leave closing token in place for other productions to
3387+ # Leave closing token in place for other productions to
33883388 # recover with
33893389 # ) ==> error
33903390 msg = leading_kind == K " EndMarker" ?
@@ -3395,4 +3395,3 @@ function parse_atom(ps::ParseState, check_identifiers=true)
33953395 bump (ps, error= " invalid syntax atom" )
33963396 end
33973397end
3398-
0 commit comments