Parcourir la source

Allow pointer types in typedefs

pull/1/head
Max Brunsfeld il y a 11 ans
Parent
révision
ccdbf809ad
2 fichiers modifiés avec 10 ajouts et 2 suppressions
  1. +1
    -1
      grammar.coffee
  2. +9
    -1
      grammar_test/declarations.txt

+ 1
- 1
grammar.coffee Voir le fichier

@ -45,7 +45,7 @@ module.exports = grammar
typedef: -> seq( typedef: -> seq(
keyword("typedef"), keyword("typedef"),
@type, @type,
@identifier,
@type_expression,
";") ";")
var_declaration: -> seq( var_declaration: -> seq(

+ 9
- 1
grammar_test/declarations.txt Voir le fichier

@ -110,9 +110,17 @@ Typedefs
typedef int my_int; typedef int my_int;
typedef struct{
int x;
} *a;
--- ---
(typedef (identifier) (identifier))
(program
(typedef (identifier) (identifier))
(typedef (struct_type
(field (identifier) (identifier)))
(pointer_type (identifier))))
============================================ ============================================
Function declarations Function declarations

Chargement…
Annuler
Enregistrer