Add boolean literals

This commit is contained in:
Bruno BELANYI 2024-04-07 23:39:47 +01:00
parent db2e88a539
commit 9dd109b90a
5 changed files with 2581 additions and 600 deletions

View file

@ -34,6 +34,7 @@ module.exports = grammar({
_expr: ($) => choice(
// Literals
$.identifier,
$.boolean_literal,
$.integer_literal,
$._string_literal,
// Composites
@ -44,6 +45,8 @@ module.exports = grammar({
// The Blueprint scanner makes use of Go's lexer, so copy their rule
identifier: (_) => /[_\p{XID_Start}][_\p{XID_Continue}]*/,
boolean_literal: (_) => choice("true", "false"),
integer_literal: (_) => seq(optional("-"), /[0-9]+/),
// The Blueprint scanner makes use of Go's lexer, so copy their rule