Pārlūkot izejas kodu

Allow unsigned, short, etc to be their own types

pull/6/head
Max Brunsfeld pirms 9 gadiem
vecāks
revīzija
367cd73ee2
4 mainītis faili ar 28812 papildinājumiem un 28707 dzēšanām
  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 Parādīt failu

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

+ 2
- 1
grammar.js Parādīt failu

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

+ 13
- 2
src/grammar.json Parādīt failu

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

+ 28792
- 28703
src/parser.c
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt