Fix line comments syntax
Don't write parsers after midnight kids. For the explanation: I mixed up the syntax bits between Blueprint and textual protocol buffers...
This commit is contained in:
parent
7bacff2471
commit
6d3dd1c8cb
|
@ -11,7 +11,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
extras: ($) => [
|
extras: ($) => [
|
||||||
/\s+/,
|
/\s+/,
|
||||||
$.comment,
|
$.line_comment,
|
||||||
],
|
],
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -22,7 +22,7 @@ module.exports = grammar({
|
||||||
$.module,
|
$.module,
|
||||||
),
|
),
|
||||||
|
|
||||||
comment: (_) => seq("#", /.*/),
|
line_comment: (_) => seq("//", /.*/),
|
||||||
|
|
||||||
// Definitions {{{
|
// Definitions {{{
|
||||||
|
|
||||||
|
|
6
src/grammar.json
generated
6
src/grammar.json
generated
|
@ -21,12 +21,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"comment": {
|
"line_comment": {
|
||||||
"type": "SEQ",
|
"type": "SEQ",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "#"
|
"value": "//"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
|
@ -935,7 +935,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "comment"
|
"name": "line_comment"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"conflicts": [],
|
"conflicts": [],
|
||||||
|
|
18
src/node-types.json
generated
18
src/node-types.json
generated
|
@ -172,11 +172,6 @@
|
||||||
"named": true,
|
"named": true,
|
||||||
"fields": {}
|
"fields": {}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "comment",
|
|
||||||
"named": true,
|
|
||||||
"fields": {}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "default_case",
|
"type": "default_case",
|
||||||
"named": true,
|
"named": true,
|
||||||
|
@ -259,6 +254,11 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "line_comment",
|
||||||
|
"named": true,
|
||||||
|
"fields": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "list_expression",
|
"type": "list_expression",
|
||||||
"named": true,
|
"named": true,
|
||||||
|
@ -632,10 +632,6 @@
|
||||||
"type": "\"",
|
"type": "\"",
|
||||||
"named": false
|
"named": false
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "#",
|
|
||||||
"named": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "(",
|
"type": "(",
|
||||||
"named": false
|
"named": false
|
||||||
|
@ -652,6 +648,10 @@
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"named": false
|
"named": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "//",
|
||||||
|
"named": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": ":",
|
"type": ":",
|
||||||
"named": false
|
"named": false
|
||||||
|
|
1479
src/parser.c
generated
1479
src/parser.c
generated
File diff suppressed because it is too large
Load diff
|
@ -2,33 +2,33 @@
|
||||||
Empty comment
|
Empty comment
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
#
|
//
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
(source_file
|
(source_file
|
||||||
(comment))
|
(line_comment))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Single comment
|
Single comment
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
# This is a comment
|
// This is a comment
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
(source_file
|
(source_file
|
||||||
(comment))
|
(line_comment))
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Multiple comments
|
Multiple comments
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
# This is a comment
|
// This is a comment
|
||||||
# This is a second comment
|
// This is a second comment
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
(source_file
|
(source_file
|
||||||
(comment)
|
(line_comment)
|
||||||
(comment))
|
(line_comment))
|
||||||
|
|
Loading…
Reference in a new issue