Remove array typedef syntax (#3477)

* remove array typedef support completely

* extraneous semicolon

* binary
This commit is contained in:
Matthew Kennedy 2021-11-06 06:12:43 -07:00 committed by GitHub
parent ab668c5bed
commit a38b3f00c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 39 deletions

View File

@ -446,7 +446,7 @@ bit useTLE8888_stepper
bit enableMapEstimationTableFallback;+If enabled, the MAP estimate table will be used if the MAP sensor fails to estimate manifold pressure based on RPM and TPS.
bit useFSIOTableForCanSniffingFiltering
bit issue_294_29
bit artificialTestMisfire,"Danger Mode","No thank you";Experimental setting that will cause a misfire\nDO NOT ENABLE.;
bit artificialTestMisfire,"Danger Mode","No thank you";Experimental setting that will cause a misfire\nDO NOT ENABLE.
bit issue_294_31,"si_example","nada_example"

Binary file not shown.

View File

@ -123,10 +123,9 @@ enumRhs
enumTypedefSuffix: /*ignored*/integer Bits ',' Datatype ',' '@OFFSET@' ',' '[' integer ':' integer ']' ',' enumRhs ;
scalarTypedefSuffix: /*ignored*/integer Scalar ',' Datatype ',' '@OFFSET@' fieldOptionsList ;
arrayTypedefSuffix: /*ignored*/arrayLengthSpec Array ',' Datatype ',' '@OFFSET@' ',' '[' arrayLengthSpec ']' fieldOptionsList;
stringTypedefSuffix: /*ignored*/replacementIdent 'string' ',' 'ASCII' ',' '@OFFSET@' ',' numexpr;
typedef: Custom identifier (enumTypedefSuffix | scalarTypedefSuffix | arrayTypedefSuffix | stringTypedefSuffix);
typedef: Custom identifier (enumTypedefSuffix | scalarTypedefSuffix | stringTypedefSuffix);
// Root statement is allowed to appear in the root of the file
rootStatement

View File

@ -227,16 +227,6 @@ public class ParseState {
typedefs.put(typedefName, new EnumTypedef(typedefName, datatype, endBit, values));
}
@Override
public void exitArrayTypedefSuffix(RusefiConfigGrammarParser.ArrayTypedefSuffixContext ctx) {
Type datatype = Type.findByTsType(ctx.Datatype().getText());
FieldOptions options = new FieldOptions();
handleFieldOptionsList(options, ctx.fieldOptionsList());
typedefs.put(typedefName, new ArrayTypedef(ParseState.this.typedefName, this.arrayDim, datatype, options));
}
@Override
public void exitStringTypedefSuffix(RusefiConfigGrammarParser.StringTypedefSuffixContext ctx) {
Double stringLength = ParseState.this.evalResults.remove();
@ -344,17 +334,6 @@ public class ParseState {
options = scTypedef.options.copy();
// Switch to the "real" type, that is the typedef's type
type = scTypedef.type.cType;
} else if (typedef instanceof ArrayTypedef) {
ArrayTypedef arTypedef = (ArrayTypedef) typedef;
// Copy the typedef's options list - we don't want to edit it
options = arTypedef.options.copy();
// Merge the read-in options list with the default from the typedef (if exists)
handleFieldOptionsList(options, ctx.fieldOptionsList());
ScalarField prototype = new ScalarField(arTypedef.type, name, options, autoscale);
scope.structFields.add(new ArrayField<>(prototype, arTypedef.length, false));
return;
} else if (typedef instanceof EnumTypedef) {
EnumTypedef bTypedef = (EnumTypedef) typedef;

View File

@ -1,15 +0,0 @@
package com.rusefi.newparse.parsing;
public class ArrayTypedef extends Typedef {
public final FieldOptions options;
public final Type type;
public final int[] length;
public ArrayTypedef(String name, int[] length, Type type, FieldOptions options) {
super(name);
this.length = length;
this.type = type;
this.options = options;
}
}