Skip to content

Commit 59e6ad5

Browse files
committed
Parse whitespaces
1 parent 6be7dde commit 59e6ad5

File tree

12 files changed

+35181
-20034
lines changed

12 files changed

+35181
-20034
lines changed

grammar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ module.exports = grammar({
6868
$._preproc_unary_operator,
6969
$.hollerith_constant,
7070
$.macro_identifier,
71+
$.whitespace,
7172
],
7273

7374
extras: $ => [
7475
// This allows escaping newlines everywhere, although this is only valid in
7576
// preprocessor statements
7677
/\s|\\\r?\n/,
78+
$.whitespace,
7779
$.comment,
7880
$.multiline_preproc_comment,
7981
'&',

src/grammar.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22047,6 +22047,10 @@
2204722047
"type": "PATTERN",
2204822048
"value": "\\s|\\\\\\r?\\n"
2204922049
},
22050+
{
22051+
"type": "SYMBOL",
22052+
"name": "whitespace"
22053+
},
2205022054
{
2205122055
"type": "SYMBOL",
2205222056
"name": "comment"
@@ -22197,6 +22201,10 @@
2219722201
{
2219822202
"type": "SYMBOL",
2219922203
"name": "macro_identifier"
22204+
},
22205+
{
22206+
"type": "SYMBOL",
22207+
"name": "whitespace"
2220022208
}
2220122209
],
2220222210
"inline": [

src/node-types.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7927,11 +7927,11 @@
79277927
},
79287928
{
79297929
"type": "none",
7930-
"named": true
7930+
"named": false
79317931
},
79327932
{
79337933
"type": "none",
7934-
"named": false
7934+
"named": true
79357935
},
79367936
{
79377937
"type": "nopass",
@@ -8209,6 +8209,11 @@
82098209
"type": "while",
82108210
"named": false
82118211
},
8212+
{
8213+
"type": "whitespace",
8214+
"named": true,
8215+
"extra": true
8216+
},
82128217
{
82138218
"type": "write",
82148219
"named": false

0 commit comments

Comments
 (0)