From 5f9dcd4946595a36624d9adcc9161542a6697c97 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 24 Jan 2024 17:42:40 -0500 Subject: [PATCH] feat: add literal types --- grammar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grammar.js b/grammar.js index 0d6692f..63e36d5 100644 --- a/grammar.js +++ b/grammar.js @@ -148,6 +148,7 @@ module.exports = grammar(lua, { $.field_type, $.union_type, $.optional_type, + $.literal_type, )), builtin_type: _ => choice( @@ -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,