Skip to content

Commit adcee93

Browse files
committed
misc fixups
1 parent 20fb336 commit adcee93

File tree

6 files changed

+49
-36
lines changed

6 files changed

+49
-36
lines changed

grammar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,27 +1201,27 @@ module.exports = grammar({
12011201
choice(
12021202
seq(
12031203
"`",
1204-
field("content", token.immediate(prec(1, /[^`]*/))),
1204+
token.immediate(prec(1, /[^`]*/)),
12051205
token.immediate(/`[cdw]?/),
12061206
),
12071207
seq(
12081208
'r"',
1209-
field("content", token.immediate(prec(1, /[^"]*/))),
1209+
token.immediate(prec(1, /[^"]*/)),
12101210
token.immediate(/"[cdw]?/),
12111211
),
12121212
),
12131213

12141214
hex_string: ($) =>
12151215
seq(
12161216
'x"',
1217-
field("content", token.immediate(prec(1, /[0-9A-Fa-f\s]*/))),
1217+
token.immediate(prec(1, /[0-9A-Fa-f\s]*/)),
12181218
token.immediate(/"[cdw]?/),
12191219
),
12201220

12211221
quoted_string: ($) =>
12221222
seq(
12231223
'"',
1224-
field("content", repeat(choice(/[^"\\]+/, $.escape_sequence))),
1224+
repeat(choice(/[^"\\]+/, $.escape_sequence)),
12251225
token.immediate(/"[cdw]?/),
12261226
),
12271227

queries/nova-highlights.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(float_literal) @value.number
2626
(char_literal) @value.number ; not sure what is best for this
2727
(special_keyword) @value.symbols
28-
(htmlenttity) @value.entity
28+
(htmlentity) @value.entity
2929
(escape_sequence) @value.entity
3030

3131
[
@@ -254,7 +254,7 @@
254254
(version_specification (version) (int_literal) @invalid) ; deprecated in 2.101
255255
(version_condition (identifier) @value.symbol)
256256

257-
(module_fqn) @cdata ; this is a crummy workaround since we don't have anything for imports
257+
(module_fqn) @processing ; this is a crummy workaround since we don't have anything for imports
258258
(module_declaration (module_fqn)) @definition.package
259259
(class_declaration (identifier) @identifier.type.class)
260260
(struct_declaration (identifier) @identifier.type.struct)

src/grammar.json

Lines changed: 12 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser.c

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/quotedstring.scm

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ auto s3 = "a\u1234b\\";
4747
================================================================================
4848
Quoted String with Character Entity
4949
================================================================================
50-
auto s3 = "a\&trademark;";
50+
auto s3 = "a\&trademark;over";
5151

5252
--------------------------------------------------------------------------------
5353

@@ -91,3 +91,21 @@ auto s10 = "🥂"w;
9191
(identifier)
9292
(string_literal
9393
(quoted_string))))
94+
95+
================================================================================
96+
Quoted String with Entity
97+
================================================================================
98+
99+
auto s10 = "alpha\ beta"w;
100+
101+
--------------------------------------------------------------------------------
102+
103+
(source_file
104+
(auto_declaration
105+
(storage_class
106+
(auto))
107+
(identifier)
108+
(string_literal
109+
(quoted_string
110+
(escape_sequence
111+
(htmlentity))))))

0 commit comments

Comments
 (0)