Skip to content

Commit

Permalink
feat: add literal types
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Jan 24, 2024
1 parent e3389a4 commit 5f9dcd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grammar.js
Expand Up @@ -148,6 +148,7 @@ module.exports = grammar(lua, {
$.field_type,
$.union_type,
$.optional_type,
$.literal_type,
)),

builtin_type: _ => choice(
Expand Down Expand Up @@ -202,6 +203,8 @@ module.exports = grammar(lua, {

optional_type: $ => seq($.type, '?'),

literal_type: $ => choice($.string, $.true, $.false),

expression: ($, original) => choice(
...original.members.filter(member => member.name !== 'unary_expression'),
$.cast_expression,
Expand Down

0 comments on commit 5f9dcd4

Please sign in to comment.