Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMcCulloh authored and github-actions[bot] committed Apr 26, 2024
1 parent bd1d35c commit cd9a249
Show file tree
Hide file tree
Showing 9 changed files with 28,035 additions and 26,892 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-wing"
description = "Wing grammar for tree-sitter"
version = "0.71.0"
version = "0.72.12"
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "wing"]
Expand Down
2 changes: 1 addition & 1 deletion Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ const PREC = {
UNARY: 120,
OPTIONAL_TEST: 130,
POWER: 140,
MEMBER: 150,
CALL: 160,
OPTIONAL_UNWRAP: 170,
STRUCTURED_ACCESS: 150, // x[y]
MEMBER: 160,
CALL: 170,
OPTIONAL_UNWRAP: 180,
};

module.exports = grammar({
Expand Down Expand Up @@ -353,7 +354,14 @@ module.exports = grammar({

// Primitives
_literal: ($) =>
choice($.string, $.number, $.bool, $.duration, $.nil_value),
choice(
$.string,
$.non_interpolated_string,
$.number,
$.bool,
$.duration,
$.nil_value
),

number: ($) => choice($._integer, $._decimal),
_integer: ($) => /\d[\d_]*/,
Expand All @@ -379,6 +387,12 @@ module.exports = grammar({
months: ($) => seq(field("value", $.number), "mo"),
years: ($) => seq(field("value", $.number), "y"),
nil_value: ($) => "nil",
non_interpolated_string: ($) =>
seq(
'#"',
repeat(choice($._non_interpolated_string_fragment, $._escape_sequence)),
'"'
),
string: ($) =>
seq(
'"',
Expand All @@ -393,6 +407,8 @@ module.exports = grammar({
),
template_substitution: ($) => seq("{", $.expression, "}"),
_string_fragment: ($) => token.immediate(prec(1, /[^{"\\]+/)),
_non_interpolated_string_fragment: ($) =>
token.immediate(prec(1, /[^"\\]+/)),
_escape_sequence: ($) =>
token.immediate(
seq(
Expand Down Expand Up @@ -674,7 +690,7 @@ module.exports = grammar({
map_literal_member: ($) => seq($.expression, "=>", $.expression),
struct_literal_member: ($) => seq($.identifier, ":", $.expression),
structured_access_expression: ($) =>
prec.right(seq($.expression, "[", $.expression, "]")),
prec.right(PREC.STRUCTURED_ACCESS, seq($.expression, "[", $.expression, "]")),

json_literal: ($) =>
choice(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglang/tree-sitter-wing",
"version": "0.71.0",
"version": "0.72.12",
"description": "winglang grammar for tree-sitter",
"main": "bindings/node",
"types": "bindings/node",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "tree-sitter-wing"
description = "Wing grammar for tree-sitter"
version = "0.71.0"
version = "0.72.12"
keywords = ["incremental", "parsing", "tree-sitter", "wing"]
classifiers = [
"Intended Audience :: Developers",
Expand Down
52 changes: 48 additions & 4 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cd9a249

Please sign in to comment.