Просмотр исходного кода

Parse top-level macro invocations

Fixes atom/atom#18346
pull/16/merge
Max Brunsfeld 7 лет назад
Родитель
Сommit
6744ae08ea
4 измененных файлов: 49472 добавлений и 45962 удалений
  1. +13
    -0
      corpus/ambiguities.txt
  2. +1
    -0
      grammar.js
  3. +13
    -0
      src/grammar.json
  4. +49445
    -45962
      src/parser.c

+ 13
- 0
corpus/ambiguities.txt Просмотреть файл

@ -163,3 +163,16 @@ int main() {
(expression_statement (identifier)))) (expression_statement (identifier))))
(comment) (comment)
(expression_statement (identifier))))) (expression_statement (identifier)))))
===============================================
Top-level macro invocations
===============================================
DEFINE_SOMETHING(THING_A, "this is a thing a");
DEFINE_SOMETHING(THING_B, "this is a thing b", "thanks");
---
(translation_unit
(call_expression (identifier) (argument_list (identifier) (string_literal)))
(call_expression (identifier) (argument_list (identifier) (string_literal) (string_literal))))

+ 1
- 0
grammar.js Просмотреть файл

@ -56,6 +56,7 @@ module.exports = grammar({
$.function_definition, $.function_definition,
$.linkage_specification, $.linkage_specification,
$.declaration, $.declaration,
seq($.call_expression, ';'),
$.type_definition, $.type_definition,
$._empty_declaration, $._empty_declaration,
$.preproc_if, $.preproc_if,

+ 13
- 0
src/grammar.json Просмотреть файл

@ -24,6 +24,19 @@
"type": "SYMBOL", "type": "SYMBOL",
"name": "declaration" "name": "declaration"
}, },
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "call_expression"
},
{
"type": "STRING",
"value": ";"
}
]
},
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "type_definition" "name": "type_definition"

+ 49445
- 45962
src/parser.c
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


Загрузка…
Отмена
Сохранить