瀏覽代碼

Fix preprocessor argument parsing with CRLF line endings

Fixes #11
pull/16/merge
Max Brunsfeld 7 年之前
父節點
當前提交
ce980349b2
共有 3 個文件被更改,包括 1062 次插入1037 次删除
  1. +1
    -1
      grammar.js
  2. +2
    -11
      src/grammar.json
  3. +1059
    -1025
      src/parser.c

+ 1
- 1
grammar.js 查看文件

@ -117,7 +117,7 @@ module.exports = grammar({
...preprocIf( '_in_field_declaration_list', $ => $._field_declaration_list_item),
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

+ 2
- 11
src/grammar.json 查看文件

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

+ 1059
- 1025
src/parser.c
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存