Explorar el Código

Handle postfix type qualifiers in compound literals

Fixes atom/language-c#312
pull/17/head
Max Brunsfeld hace 7 años
padre
commit
175d93b439
Se han modificado 4 ficheros con 27932 adiciones y 27846 borrados
  1. +8
    -1
      corpus/expressions.txt
  2. +1
    -0
      grammar.js
  3. +7
    -0
      src/grammar.json
  4. +27916
    -27845
      src/parser.c

+ 8
- 1
corpus/expressions.txt Ver fichero

@ -346,6 +346,7 @@ int main() {
7,
8
};
z = (char const []) {'a', 'b'};
}
---
@ -374,7 +375,13 @@ int main() {
(type_descriptor (struct_specifier (type_identifier)))
(initializer_list
(number_literal)
(number_literal))))))))
(number_literal)))))
(expression_statement
(assignment_expression
(identifier)
(compound_literal_expression
(type_descriptor (primitive_type) (type_qualifier) (abstract_array_declarator))
(initializer_list (char_literal) (char_literal))))))))
============================================
Compound literals with trailing commas

+ 1
- 0
grammar.js Ver fichero

@ -600,6 +600,7 @@ module.exports = grammar({
type_descriptor: $ => seq(
repeat($.type_qualifier),
$._type_specifier,
repeat($.type_qualifier),
optional($._abstract_declarator)
),

+ 7
- 0
src/grammar.json Ver fichero

@ -3399,6 +3399,13 @@
"type": "SYMBOL",
"name": "_type_specifier"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "CHOICE",
"members": [

+ 27916
- 27845
src/parser.c
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


Cargando…
Cancelar
Guardar