separate ^-strings from normal ones
This commit is contained in:
parent
e62088ee87
commit
1a197b26ab
5 changed files with 2370 additions and 2353 deletions
|
@ -5,6 +5,7 @@ module.exports = grammar({
|
||||||
source_file: $ => seq(repeat($._statement)),
|
source_file: $ => seq(repeat($._statement)),
|
||||||
_unspaced_statement: $ => seq(
|
_unspaced_statement: $ => seq(
|
||||||
choice(
|
choice(
|
||||||
|
$.ministring,
|
||||||
$.string,
|
$.string,
|
||||||
$.number,
|
$.number,
|
||||||
$.function_definition,
|
$.function_definition,
|
||||||
|
@ -53,10 +54,8 @@ module.exports = grammar({
|
||||||
$.identifier,
|
$.identifier,
|
||||||
),
|
),
|
||||||
number: $ => token(prec(10, /\d+(\.\d+)?/)),
|
number: $ => token(prec(10, /\d+(\.\d+)?/)),
|
||||||
string: $ => choice(
|
ministring: $ => token(prec(10, seq('^', /[^ \n\r\t<>:;&{}"'\[\],]+/))),
|
||||||
token(prec(10, seq('^', /[^ \n\r\t<>:;&{}"'\[\],]+/))),
|
string: $ => seq('"', repeat(choice(/\\./, /./)), '"'),
|
||||||
seq('"', repeat(choice(/\\./, /./)), '"'),
|
|
||||||
),
|
|
||||||
call_expr: $ => seq('<', optional($._spacing), repeat($._statement), $._unspaced_statement, '>'),
|
call_expr: $ => seq('<', optional($._spacing), repeat($._statement), $._unspaced_statement, '>'),
|
||||||
with_expr: $ => seq(
|
with_expr: $ => seq(
|
||||||
'with', $._spacing,
|
'with', $._spacing,
|
||||||
|
|
|
@ -16,3 +16,4 @@
|
||||||
(call (call) @function (identifier) @property)
|
(call (call) @function (identifier) @property)
|
||||||
(def (identifier) @local.definition)
|
(def (identifier) @local.definition)
|
||||||
(with_expr (identifier) @local.definition)
|
(with_expr (identifier) @local.definition)
|
||||||
|
(ministring) @string.special.symbol
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
{
|
{
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
"members": [
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "ministring"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "string"
|
"name": "string"
|
||||||
|
@ -338,10 +342,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string": {
|
"ministring": {
|
||||||
"type": "CHOICE",
|
|
||||||
"members": [
|
|
||||||
{
|
|
||||||
"type": "TOKEN",
|
"type": "TOKEN",
|
||||||
"content": {
|
"content": {
|
||||||
"type": "PREC",
|
"type": "PREC",
|
||||||
|
@ -361,7 +362,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
"string": {
|
||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
@ -389,8 +390,6 @@
|
||||||
"value": "\""
|
"value": "\""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"call_expr": {
|
"call_expr": {
|
||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -106,6 +110,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -211,6 +219,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -282,6 +294,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -406,6 +422,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -494,6 +514,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -604,6 +628,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"named": true
|
"named": true
|
||||||
|
@ -738,6 +766,10 @@
|
||||||
"type": "include",
|
"type": "include",
|
||||||
"named": false
|
"named": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ministring",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "namespace",
|
"type": "namespace",
|
||||||
"named": false
|
"named": false
|
||||||
|
|
4598
src/parser.c
4598
src/parser.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue