Open tempelmann opened 7 years ago
It seems adding Unit.addUniqueAttr
might be the solution. This adds the missing declaration:
case t: BytesType =>
val rawId = RawIdentifier(id)
Utils.addUniqueAttr(extraAttrs, AttrSpec(List(), rawId, dataType))
attrParse2(rawId, dataType, io, extraAttrs, rep, false, defEndian, Some(assignType))
I propose to start with addition of relevant test case into tests. Usually this means:
formats/name_of_the_test.ksy
specs/$LANG/...
(preferably in Ruby, as they could be semi-automatically converted to other languages by spec-ruby-to-$LANG
family of scripts — spec_translate_missing
would usually do all the possible conversions)That would allow to check the situation with all other languages as well and see if they need any fixes or not.
This code:
Generates something along these lines (slightly simplified):
The problem is
m_raw_v2
: It is never declared in the header file, leading to a compile error.The CppCompiler never learns of this raw type, and therefore doesn't know that it has to generate the property in the class definition.
The culprit is found in
EveryReadIsExpression
, insideattrSwitchTypeParse()
:It generates a RawIdentifier without passing that information on or adding it to the list of attributes. It simply gets forgotten right away. This needs fixing so that the raw attribute is passed to the compiler via
attributeDeclaration
.