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

Allow unsigned, short, etc to be their own types

pull/6/head
Max Brunsfeld 9 лет назад
Родитель
Сommit
367cd73ee2
4 измененных файлов: 28812 добавлений и 28707 удалений
  1. +5
    -1
      corpus/declarations.txt
  2. +2
    -1
      grammar.js
  3. +13
    -2
      src/grammar.json
  4. +28792
    -28703
      src/parser.c

+ 5
- 1
corpus/declarations.txt Просмотреть файл

@ -70,6 +70,8 @@ Primitive-typed variable declarations
unsigned short int a; unsigned short int a;
long int b, c = 5, d; long int b, c = 5, d;
float d, e; float d, e;
unsigned f;
short g, h;
--- ---
@ -80,7 +82,9 @@ float d, e;
(identifier) (identifier)
(init_declarator (identifier) (number_literal)) (init_declarator (identifier) (number_literal))
(identifier)) (identifier))
(declaration (identifier) (identifier) (identifier)))
(declaration (identifier) (identifier) (identifier))
(declaration (sized_type_specifier) (identifier))
(declaration (sized_type_specifier) (identifier) (identifier)))
============================================ ============================================
Variable storage classes Variable storage classes

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

@ -33,6 +33,7 @@ module.exports = grammar({
[$.sizeof_expression, $.cast_expression], [$.sizeof_expression, $.cast_expression],
[$._type_specifier, $._expression, $.macro_type_specifier], [$._type_specifier, $._expression, $.macro_type_specifier],
[$._type_specifier, $.macro_type_specifier], [$._type_specifier, $.macro_type_specifier],
[$.sized_type_specifier],
], ],
rules: { rules: {
@ -240,7 +241,7 @@ module.exports = grammar({
'long', 'long',
'short' 'short'
)), )),
$.identifier
optional($.identifier)
), ),
enum_specifier: $ => seq( enum_specifier: $ => seq(

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

@ -956,8 +956,16 @@
} }
}, },
{ {
"type": "SYMBOL",
"name": "identifier"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
} }
] ]
}, },
@ -3157,6 +3165,9 @@
[ [
"_type_specifier", "_type_specifier",
"macro_type_specifier" "macro_type_specifier"
],
[
"sized_type_specifier"
] ]
], ],
"externals": [] "externals": []

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


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