tree-sitter-bynk 0.371.3 → 0.377.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +17 -17
- package/package.json +1 -1
- package/src/grammar.json +14 -23
- package/src/parser.c +38792 -42148
- package/src/scanner.c +32 -7
package/grammar.js
CHANGED
|
@@ -39,7 +39,7 @@ const PREC = {
|
|
|
39
39
|
module.exports = grammar({
|
|
40
40
|
name: "bynk",
|
|
41
41
|
|
|
42
|
-
externals: ($) => [$.doc_block],
|
|
42
|
+
externals: ($) => [$.doc_block, $.doc_line],
|
|
43
43
|
|
|
44
44
|
extras: ($) => [/\s+/, $.doc_line, $.line_comment, $.doc_block],
|
|
45
45
|
|
|
@@ -1781,7 +1781,15 @@ module.exports = grammar({
|
|
|
1781
1781
|
string_literal: ($) =>
|
|
1782
1782
|
seq(
|
|
1783
1783
|
'"',
|
|
1784
|
-
|
|
1784
|
+
// #2203: string text is one high-precedence immediate token, so a
|
|
1785
|
+
// `//` inside a string (a URL) is text, not a line comment.
|
|
1786
|
+
repeat(
|
|
1787
|
+
choice(
|
|
1788
|
+
token.immediate(prec(1, /[^"\\\n]+/)),
|
|
1789
|
+
/\\[nt"\\]/,
|
|
1790
|
+
$.string_interpolation,
|
|
1791
|
+
),
|
|
1792
|
+
),
|
|
1785
1793
|
'"',
|
|
1786
1794
|
),
|
|
1787
1795
|
// v0.43: an interpolation hole `\(expr)`. A bare `\(` was an invalid
|
|
@@ -1791,21 +1799,13 @@ module.exports = grammar({
|
|
|
1791
1799
|
boolean_literal: () => choice("true", "false"),
|
|
1792
1800
|
unit_literal: () => seq("(", ")"),
|
|
1793
1801
|
|
|
1794
|
-
//
|
|
1795
|
-
//
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
//
|
|
1801
|
-
// `--|` line to its end, so the higher lexical precedence makes it a
|
|
1802
|
-
// doc. The compiler takes `--|` as a doc only when it is the first thing
|
|
1803
|
-
// on its line; an extras token cannot see that, so a `--|` after code on
|
|
1804
|
-
// the same line highlights as a doc here though it compiles as a comment.
|
|
1805
|
-
doc_line: () => token(prec(1, seq("--|", /[^\n]*/))),
|
|
1806
|
-
|
|
1807
|
-
// `doc_block` is provided by the external scanner — see src/scanner.c.
|
|
1808
|
-
// The grammar references it via the `externals` array above.
|
|
1802
|
+
// #2203: a `//` line comment, anywhere. There is no prefix `/`, so
|
|
1803
|
+
// `a//b` cannot mean anything else.
|
|
1804
|
+
line_comment: () => token(seq("//", /[^\n]*/)),
|
|
1805
|
+
|
|
1806
|
+
// `doc_block` and `doc_line` (#2203: a `--- text` one-line doc, first on
|
|
1807
|
+
// its line) are provided by the external scanner — see src/scanner.c. The
|
|
1808
|
+
// grammar references them via the `externals` array above.
|
|
1809
1809
|
},
|
|
1810
1810
|
});
|
|
1811
1811
|
|
package/package.json
CHANGED
package/src/grammar.json
CHANGED
|
@@ -8670,8 +8670,15 @@
|
|
|
8670
8670
|
"type": "CHOICE",
|
|
8671
8671
|
"members": [
|
|
8672
8672
|
{
|
|
8673
|
-
"type": "
|
|
8674
|
-
"
|
|
8673
|
+
"type": "IMMEDIATE_TOKEN",
|
|
8674
|
+
"content": {
|
|
8675
|
+
"type": "PREC",
|
|
8676
|
+
"value": 1,
|
|
8677
|
+
"content": {
|
|
8678
|
+
"type": "PATTERN",
|
|
8679
|
+
"value": "[^\"\\\\\\n]+"
|
|
8680
|
+
}
|
|
8681
|
+
}
|
|
8675
8682
|
},
|
|
8676
8683
|
{
|
|
8677
8684
|
"type": "PATTERN",
|
|
@@ -8740,7 +8747,7 @@
|
|
|
8740
8747
|
"members": [
|
|
8741
8748
|
{
|
|
8742
8749
|
"type": "STRING",
|
|
8743
|
-
"value": "
|
|
8750
|
+
"value": "//"
|
|
8744
8751
|
},
|
|
8745
8752
|
{
|
|
8746
8753
|
"type": "PATTERN",
|
|
@@ -8748,26 +8755,6 @@
|
|
|
8748
8755
|
}
|
|
8749
8756
|
]
|
|
8750
8757
|
}
|
|
8751
|
-
},
|
|
8752
|
-
"doc_line": {
|
|
8753
|
-
"type": "TOKEN",
|
|
8754
|
-
"content": {
|
|
8755
|
-
"type": "PREC",
|
|
8756
|
-
"value": 1,
|
|
8757
|
-
"content": {
|
|
8758
|
-
"type": "SEQ",
|
|
8759
|
-
"members": [
|
|
8760
|
-
{
|
|
8761
|
-
"type": "STRING",
|
|
8762
|
-
"value": "--|"
|
|
8763
|
-
},
|
|
8764
|
-
{
|
|
8765
|
-
"type": "PATTERN",
|
|
8766
|
-
"value": "[^\\n]*"
|
|
8767
|
-
}
|
|
8768
|
-
]
|
|
8769
|
-
}
|
|
8770
|
-
}
|
|
8771
8758
|
}
|
|
8772
8759
|
},
|
|
8773
8760
|
"extras": [
|
|
@@ -8822,6 +8809,10 @@
|
|
|
8822
8809
|
{
|
|
8823
8810
|
"type": "SYMBOL",
|
|
8824
8811
|
"name": "doc_block"
|
|
8812
|
+
},
|
|
8813
|
+
{
|
|
8814
|
+
"type": "SYMBOL",
|
|
8815
|
+
"name": "doc_line"
|
|
8825
8816
|
}
|
|
8826
8817
|
],
|
|
8827
8818
|
"inline": [],
|