Kaynağa Gözat

Parse top-level macro invocations

Fixes atom/atom#18346
pull/16/merge
Max Brunsfeld 7 yıl önce
ebeveyn
işleme
6744ae08ea
4 değiştirilmiş dosya ile 49472 ekleme ve 45962 silme
  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 Dosyayı Görüntüle

@ -163,3 +163,16 @@ int main() {
(expression_statement (identifier))))
(comment)
(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 Dosyayı Görüntüle

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

+ 13
- 0
src/grammar.json Dosyayı Görüntüle

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

+ 49445
- 45962
src/parser.c
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


Yükleniyor…
İptal
Kaydet