assert that C and TS enum sizes match #3786
This commit is contained in:
parent
1990086c1c
commit
3951d3236b
Binary file not shown.
|
@ -39,7 +39,7 @@ FloatChars: IntegerChars [.] ([0-9]+)?;
|
||||||
IdentifierChars : [a-zA-Z_]([a-zA-Z0-9_]*);
|
IdentifierChars : [a-zA-Z_]([a-zA-Z0-9_]*);
|
||||||
|
|
||||||
// TODO: do we need replacementIdent AND identifier to be here?
|
// TODO: do we need replacementIdent AND identifier to be here?
|
||||||
replacementIdent: '@@' IdentifierChars '@@' | identifier;
|
replacementIdent: integer | '@@' IdentifierChars '@@' | identifier;
|
||||||
|
|
||||||
String: [a-zA-Z_0-9.']+;
|
String: [a-zA-Z_0-9.']+;
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,14 @@ public class ParseState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enterEnumTypedefSuffix(RusefiConfigGrammarParser.EnumTypedefSuffixContext ctx) {
|
public void enterEnumTypedefSuffix(RusefiConfigGrammarParser.EnumTypedefSuffixContext ctx) {
|
||||||
int endBit = Integer.parseInt(ctx.integer(2).getText());
|
String replacementIdent = ctx.replacementIdent().getText();
|
||||||
|
int endBit;
|
||||||
|
if (replacementIdent == null) {
|
||||||
|
RusefiConfigGrammarParser.IntegerContext integer = ctx.integer(2);
|
||||||
|
endBit = Integer.parseInt(integer.getText());
|
||||||
|
} else {
|
||||||
|
endBit = Integer.parseInt(replacementIdent);
|
||||||
|
}
|
||||||
Type datatype = Type.findByTsType(ctx.Datatype().getText());
|
Type datatype = Type.findByTsType(ctx.Datatype().getText());
|
||||||
|
|
||||||
String rhs = ctx.enumRhs().getText();
|
String rhs = ctx.enumRhs().getText();
|
||||||
|
|
Loading…
Reference in New Issue