Skip to content

Commit e8159ae

Browse files
Allow parsing generate_strict and b_generate_strict
1 parent cd4287f commit e8159ae

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/ktn_code.erl

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
%% since it has too many options and it's compressed.
1818
-type tree_node_type() ::
1919
'case' | 'catch' | 'else' | 'fun' | 'if' | 'maybe' | 'receive' | 'try' | any | atom |
20-
b_generate | bc | bc_expr | binary | binary_element | block | call | callback |
21-
case_clauses | case_expr | char | clause | comment | cons | default | define | else_attr |
22-
export | float | function | generate | if_attr | import | integer | lc | lc_expr |
23-
m_generate | macro | map | map_field_assoc | map_field_exact | match | maybe_match | mc |
24-
mc_expr | module | named_fun | nil | nominal | op | opaque | query | receive_after |
25-
receive_case | record | record_attr | record_field | record_index | remote | remote_type |
26-
root | spec | string | try_after | try_case | try_catch | tuple | type | type_attr |
27-
type_map_field | typed_record_field | user_type | var | atom().
20+
b_generate | b_generate_strict | bc | bc_expr | binary | binary_element | block | call |
21+
callback | case_clauses | case_expr | char | clause | comment | cons | default | define |
22+
else_attr | export | float | function | generate | generate_strict | if_attr | import |
23+
integer | lc | lc_expr | m_generate | macro | map | map_field_assoc | map_field_exact | match |
24+
maybe_match | mc | mc_expr | module | named_fun | nil | nominal | op | opaque | query |
25+
receive_after | receive_case | record | record_attr | record_field | record_index | remote |
26+
remote_type | root | spec | string | try_after | try_case | try_catch | tuple | type |
27+
type_attr | type_map_field | typed_record_field | user_type | var | atom().
2828
-type tree_node() ::
2929
#{type => tree_node_type(),
3030
attrs => map(),
@@ -544,6 +544,10 @@ to_map({generate, Attrs, Pattern, Expr}) ->
544544
#{type => generate,
545545
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},
546546
node_attrs => #{pattern => to_map(Pattern), expression => to_map(Expr)}};
547+
to_map({generate_strict, Attrs, Pattern, Expr}) ->
548+
#{type => generate_strict,
549+
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},
550+
node_attrs => #{pattern => to_map(Pattern), expression => to_map(Expr)}};
547551
to_map({lc_expr, Attrs, Expr}) ->
548552
#{type => lc_expr,
549553
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},
@@ -559,6 +563,10 @@ to_map({b_generate, Attrs, Pattern, Expr}) ->
559563
#{type => b_generate,
560564
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},
561565
node_attrs => #{pattern => to_map(Pattern), expression => to_map(Expr)}};
566+
to_map({b_generate_strict, Attrs, Pattern, Expr}) ->
567+
#{type => b_generate_strict,
568+
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},
569+
node_attrs => #{pattern => to_map(Pattern), expression => to_map(Expr)}};
562570
to_map({bc_expr, Attrs, Expr}) ->
563571
#{type => bc_expr,
564572
attrs => #{location => get_location(Attrs), text => get_text(Attrs)},

0 commit comments

Comments
 (0)