Selaa lähdekoodia

Fix preprocessor argument parsing with CRLF line endings

Fixes #11
pull/16/merge
Max Brunsfeld 7 vuotta sitten
vanhempi
commit
ce980349b2
3 muutettua tiedostoa jossa 1062 lisäystä ja 1037 poistoa
  1. +1
    -1
      grammar.js
  2. +2
    -11
      src/grammar.json
  3. +1059
    -1025
      src/parser.c

+ 1
- 1
grammar.js Näytä tiedosto

@ -117,7 +117,7 @@ module.exports = grammar({
...preprocIf( '_in_field_declaration_list', $ => $._field_declaration_list_item), ...preprocIf( '_in_field_declaration_list', $ => $._field_declaration_list_item),
preproc_directive: $ => /#[ \t]*[a-zA-Z]\w*/, preproc_directive: $ => /#[ \t]*[a-zA-Z]\w*/,
preproc_arg: $ => token(prec(-1, repeat1(choice(/./, '\\\n')))),
preproc_arg: $ => token(prec(-1, repeat1(/.|\\\r?\n/))),
// Main Grammar // Main Grammar

+ 2
- 11
src/grammar.json Näytä tiedosto

@ -953,17 +953,8 @@
"content": { "content": {
"type": "REPEAT1", "type": "REPEAT1",
"content": { "content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "."
},
{
"type": "STRING",
"value": "\\\n"
}
]
"type": "PATTERN",
"value": ".|\\\\\\r?\\n"
} }
} }
} }

+ 1059
- 1025
src/parser.c
File diff suppressed because it is too large
Näytä tiedosto


Ladataan…
Peruuta
Tallenna