Skip to content

Commit

Permalink
grammar: Add map type
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Jul 4, 2024
1 parent 467a761 commit c854441
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ module.exports = grammar({

call: $ => prec(99, seq(field("callable", $.expression), "(", field("args", optional($.argument_list)), ")")),

template_type: _ => choice("vec"),
type_name: $ => choice($.identifier, $.template_type),
type: $ => choice($.type_name, seq($.template_type, "<", $.type, ">")),
template_type: _ => choice("vec", "map"),
type_name: $ => choice($.identifier, "vec", "map"),
type: $ => choice($.type_name, seq("vec", "<", $.type, ">"), seq("map", "<", $.type, ",", $.type, ">")),

param: $ => choice($.identifier, seq($.identifier, ":", $.type)),
param_list: $ => choice($.param, seq($.param, ",", $.param_list)),
Expand Down

0 comments on commit c854441

Please sign in to comment.