always generate static const array first for atn

This commit is contained in:
Andrei DAMIAN 2020-12-18 06:48:10 +02:00
parent c79b0fd80c
commit f33a0f3d13
1 changed files with 1 additions and 9 deletions

View File

@ -422,8 +422,7 @@ static std::vector\<uint16_t> _serializedATN;
// Constructs the serialized ATN and writes init code for static member vars.
SerializedATN(model) ::= <<
<if (rest(model.segments))>
<model.segments: {segment | static uint16_t serializedATNSegment<i0>[] = {
<model.segments: {segment | static const uint16_t serializedATNSegment<i0>[] = {
<segment; wrap={<\n> }>
\};}; separator="\n">
@ -431,13 +430,6 @@ SerializedATN(model) ::= <<
serializedATNSegment<i0> + sizeof(serializedATNSegment<i0>) / sizeof(serializedATNSegment<i0>[0]));
}>
<else>
<! only one segment, can be inlined !>
_serializedATN = {
<model.serialized; wrap = {<\n>}>
};
<endif>
atn::ATNDeserializer deserializer;
_atn = deserializer.deserialize(_serializedATN);