language injection

This commit is contained in:
2026-03-07 11:45:48 -08:00
parent 7518c95769
commit 4e2c67c12d
4 changed files with 7357 additions and 7238 deletions

View File

@@ -126,7 +126,7 @@ module.exports = grammar({
// optional doesn't seem to help, so we have an error at void // optional doesn't seem to help, so we have an error at void
optional(seq("where", optional(layout($, $.sigDecl)))), optional(seq("where", optional(layout($, $.sigDecl)))),
), ),
jsLitString: $ => /`[^`]+`/, jsLitString: $ => seq("`",alias(/[^`]+/,$.jsStringFragment),"`"),
deriveDecl: $ => seq("derive", repeat1($.identifier)), deriveDecl: $ => seq("derive", repeat1($.identifier)),
pfuncDecl: ($) => seq( pfuncDecl: ($) => seq(
"pfunc", "pfunc",

22
src/grammar.json generated
View File

@@ -1062,8 +1062,26 @@
] ]
}, },
"jsLitString": { "jsLitString": {
"type": "PATTERN", "type": "SEQ",
"value": "`[^`]+`" "members": [
{
"type": "STRING",
"value": "`"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[^`]+"
},
"named": true,
"value": "jsStringFragment"
},
{
"type": "STRING",
"value": "`"
}
]
}, },
"deriveDecl": { "deriveDecl": {
"type": "SEQ", "type": "SEQ",

21
src/node-types.json generated
View File

@@ -375,6 +375,21 @@
] ]
} }
}, },
{
"type": "jsLitString",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "jsStringFragment",
"named": true
}
]
}
},
{ {
"type": "lamExpr", "type": "lamExpr",
"named": true, "named": true,
@@ -841,6 +856,10 @@
"type": "]", "type": "]",
"named": false "named": false
}, },
{
"type": "`",
"named": false
},
{ {
"type": "character", "type": "character",
"named": true "named": true
@@ -907,7 +926,7 @@
"named": false "named": false
}, },
{ {
"type": "jsLitString", "type": "jsStringFragment",
"named": true "named": true
}, },
{ {

14550
src/parser.c generated

File diff suppressed because it is too large Load Diff