@@ -382,22 +382,22 @@ function parse_LtoR(ps::ParseState, down, is_op)
382382 down (ps)
383383 while is_op (peek (ps))
384384 t = peek_token (ps)
385- bump_dotsplit (ps)
385+ bump_dotsplit (ps, remap_kind = K " Identifier " )
386386 down (ps)
387387 emit (ps, mark, is_dotted (t) ? K " dotcall" : K " call" , INFIX_FLAG)
388388 end
389389end
390390
391391# parse right-to-left binary operator
392- # produces structures like (= a (= b (= c d)))
392+ # produces structures like (=> a (=> b (=> c d)))
393393#
394394# flisp: parse-RtoL
395395function parse_RtoL (ps:: ParseState , down, is_op, self)
396396 mark = position (ps)
397397 down (ps)
398398 t = peek_token (ps)
399399 if is_op (kind (t))
400- bump_dotsplit (ps)
400+ bump_dotsplit (ps, remap_kind = K " Identifier " )
401401 self (ps)
402402 emit (ps, mark, is_dotted (t) ? K " dotcall" : K " call" , INFIX_FLAG)
403403 end
@@ -624,7 +624,7 @@ function parse_assignment_with_initial_ex(ps::ParseState, mark, down::T) where {
624624 # a .~ b ==> (dotcall-i a ~ b)
625625 # [a ~ b c] ==> (hcat (call-i a ~ b) c)
626626 # [a~b] ==> (vect (call-i a ~ b))
627- bump_dotsplit (ps)
627+ bump_dotsplit (ps, remap_kind = K " Identifier " )
628628 bump_trivia (ps)
629629 parse_assignment (ps, down)
630630 emit (ps, mark, is_dotted (t) ? K " dotcall" : K " call" , INFIX_FLAG)
@@ -759,7 +759,7 @@ function parse_arrow(ps::ParseState)
759759 # x <--> y ==> (call-i x <--> y)
760760 # x .--> y ==> (dotcall-i x --> y)
761761 # x -->₁ y ==> (call-i x -->₁ y)
762- bump_dotsplit (ps)
762+ bump_dotsplit (ps, remap_kind = K " Identifier " )
763763 parse_arrow (ps)
764764 emit (ps, mark, is_dotted (t) ? K " dotcall" : K " call" , INFIX_FLAG)
765765 end
@@ -821,7 +821,7 @@ function parse_comparison(ps::ParseState, subtype_comparison=false)
821821 while (t = peek_token (ps); is_prec_comparison (t))
822822 n_comparisons += 1
823823 op_dotted = is_dotted (t)
824- op_pos = bump_dotsplit (ps, emit_dot_node= true )
824+ op_pos = bump_dotsplit (ps, emit_dot_node= true , remap_kind = K " Identifier " )
825825 parse_pipe_lt (ps)
826826 end
827827 if n_comparisons == 1
@@ -881,7 +881,7 @@ function parse_range(ps::ParseState)
881881 # a..b ==> (call-i a .. b)
882882 # a … b ==> (call-i a … b)
883883 # a .… b ==> (dotcall-i a … b)
884- bump_dotsplit (ps)
884+ bump_dotsplit (ps, remap_kind = K " Identifier " )
885885 parse_invalid_ops (ps)
886886 emit (ps, mark, is_dotted (initial_tok) ? K " dotcall" : K " call" , INFIX_FLAG)
887887 elseif initial_kind == K " :" && ps. range_colon_enabled
@@ -904,17 +904,17 @@ function parse_range(ps::ParseState)
904904 # a :> b ==> (call-i a (error : >) b)
905905 bump_trivia (ps, skip_newlines= false )
906906 emark = position (ps)
907- bump (ps) # K":"
907+ bump (ps, remap_kind = K " Identifier " ) # K":"
908908 ks = untokenize (peek (ps))
909- bump (ps) # K"<" or K">"
909+ bump (ps, remap_kind = K " Identifier " ) # K"<" or K">"
910910 emit (ps, emark, K " error" ,
911911 error= " Invalid `:$ks ` found, maybe replace with `$ks :`" )
912912 parse_invalid_ops (ps)
913913 emit (ps, mark, K " call" , INFIX_FLAG)
914914 break
915915 end
916916 n_colons += 1
917- bump (ps, n_colons == 1 ? EMPTY_FLAGS : TRIVIA_FLAG)
917+ bump (ps, n_colons == 1 ? EMPTY_FLAGS : TRIVIA_FLAG; remap_kind = K " Identifier " )
918918 had_newline = peek (ps) == K " NewlineWs"
919919 t = peek_token (ps)
920920 if is_closing_token (ps, kind (t))
@@ -1008,7 +1008,7 @@ function parse_with_chains(ps::ParseState, down, is_op, chain_ops)
10081008 # [x+y + z] ==> (vect (call-i x + y z))
10091009 break
10101010 end
1011- bump_dotsplit (ps)
1011+ bump_dotsplit (ps, remap_kind = K " Identifier " )
10121012 down (ps)
10131013 if kind (t) in chain_ops && ! is_decorated (t)
10141014 # a + b + c ==> (call-i a + b c)
@@ -1217,7 +1217,7 @@ function parse_unary(ps::ParseState)
12171217 # unary negation
12181218 # -2^x ==> (call-pre - (call-i 2 ^ x))
12191219 # -2[1, 3] ==> (call-pre - (ref 2 1 3))
1220- bump (ps)
1220+ bump (ps, remap_kind = K " Identifier " )
12211221 parse_factor (ps)
12221222 emit (ps, mark, K " call" , PREFIX_OP_FLAG)
12231223 else
@@ -1256,7 +1256,7 @@ function parse_unary(ps::ParseState)
12561256 #
12571257 # (The flisp parser only considers commas before `;` and thus gets this
12581258 # last case wrong)
1259- op_pos = bump_dotsplit (ps, emit_dot_node= true )
1259+ op_pos = bump_dotsplit (ps, emit_dot_node= true , remap_kind = K " Identifier " )
12601260
12611261 space_before_paren = preceding_whitespace (t2)
12621262 if space_before_paren
@@ -1303,7 +1303,7 @@ function parse_unary(ps::ParseState)
13031303 if is_type_operator (op_t)
13041304 # <:(a,) ==> (<: a)
13051305 emit (ps, mark, op_k, opts. delim_flags)
1306- reset_node! (ps, op_pos, flags= TRIVIA_FLAG)
1306+ reset_node! (ps, op_pos, flags= TRIVIA_FLAG, kind = op_k )
13071307 else
13081308 emit (ps, mark, K " call" , opts. delim_flags)
13091309 end
@@ -1329,7 +1329,7 @@ function parse_unary(ps::ParseState)
13291329 if is_type_operator (op_t)
13301330 # <:(a) ==> (<:-pre (parens a))
13311331 emit (ps, mark, op_k, PREFIX_OP_FLAG)
1332- reset_node! (ps, op_pos, flags= TRIVIA_FLAG)
1332+ reset_node! (ps, op_pos, flags= TRIVIA_FLAG, kind = op_k )
13331333 else
13341334 if is_dotted (op_t)
13351335 emit (ps, mark, K " dotcall" , PREFIX_OP_FLAG)
@@ -1349,12 +1349,12 @@ function parse_unary(ps::ParseState)
13491349 # -0x1 ==> (call-pre - 0x01)
13501350 # - 2 ==> (call-pre - 2)
13511351 # .-2 ==> (dotcall-pre - 2)
1352- op_pos = bump_dotsplit (ps, EMPTY_FLAGS)
1352+ op_pos = bump_dotsplit (ps, EMPTY_FLAGS, remap_kind = K " Identifier " )
13531353 else
13541354 # /x ==> (call-pre (error /) x)
13551355 # +₁ x ==> (call-pre (error +₁) x)
13561356 # .<: x ==> (dotcall-pre (error (. <:)) x)
1357- bump_dotsplit (ps, EMPTY_FLAGS, emit_dot_node= true )
1357+ bump_dotsplit (ps, EMPTY_FLAGS, emit_dot_node= true , remap_kind = K " Identifier " )
13581358 op_pos = emit (ps, mark, K " error" , error= " not a unary operator" )
13591359 end
13601360 parse_unary (ps)
@@ -1385,7 +1385,7 @@ end
13851385function parse_factor_with_initial_ex (ps:: ParseState , mark)
13861386 parse_decl_with_initial_ex (ps, mark)
13871387 if (t = peek_token (ps); is_prec_power (kind (t)))
1388- bump_dotsplit (ps)
1388+ bump_dotsplit (ps, remap_kind = K " Identifier " )
13891389 parse_factor_after (ps)
13901390 emit (ps, mark, is_dotted (t) ? K " dotcall" : K " call" , INFIX_FLAG)
13911391 end
@@ -1687,11 +1687,12 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
16871687 macro_atname_range = (m, position (ps))
16881688 emit (ps, mark, K " ." )
16891689 elseif k == K " '"
1690+ # f.' => f (error-t (. '))
1691+ bump_dotsplit (ps, remap_kind= K " Identifier" )
16901692 # TODO : Reclaim dotted postfix operators :-)
1691- # f.' => f (error-t ')
1692- bump (ps)
1693- emit (ps, emark, K " error" , TRIVIA_FLAG,
1693+ emit (ps, emark, K " error" ,
16941694 error= " the .' operator for transpose is discontinued" )
1695+ emit (ps, mark, K " dotcall" , POSTFIX_OP_FLAG)
16951696 else
16961697 # Field/property syntax
16971698 # f.x.y ==> (. (. f x) y)
@@ -1703,7 +1704,7 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
17031704 elseif k == K " '" && ! preceding_whitespace (t)
17041705 # f' ==> (call-post f ')
17051706 # f'ᵀ ==> (call-post f 'ᵀ)
1706- bump (ps)
1707+ bump (ps, remap_kind = K " Identifier " )
17071708 emit (ps, mark, K " call" , POSTFIX_OP_FLAG)
17081709 elseif k == K " {"
17091710 # Type parameter curlies and macro calls
@@ -3554,11 +3555,8 @@ function parse_atom(ps::ParseState, check_identifiers=true)
35543555 # + ==> +
35553556 # .+ ==> (. +)
35563557 # .= ==> (. =)
3557- if is_dotted (peek_token (ps))
3558- bump_dotsplit (ps, emit_dot_node= true )
3559- else
3560- bump (ps, remap_kind= K " Identifier" )
3561- end
3558+ bump_dotsplit (ps, emit_dot_node= true , remap_kind=
3559+ is_syntactic_operator (leading_kind) ? leading_kind : K " Identifier" )
35623560 if check_identifiers && ! is_valid_identifier (leading_kind)
35633561 # += ==> (error +=)
35643562 # ? ==> (error ?)
0 commit comments