Closed MinaToma closed 4 years ago
@fangism can you add this issue to the right project.
It doesn't have to be a kDataTypePrimitive
, but it should at least be wrapped in kDataType
like any other declaration.
The parsing is correct, just the CST subtree is not re-interpreted properly.
Today we get:
Node @0 (tag: kForLoopStatement) {
Node @0 (tag: kLoopHeader) {
Leaf @0 (#"for" @39-42: "for")
Node @1 (tag: kParenGroup) {
Leaf @0 (#'(' @43-44: "(")
Node @1 (tag: kForSpec) {
Node @0 (tag: kForInitializationList) {
Node @0 (tag: kForInitialization) {
Node @1 (tag: kDataType) {
Node @1 (tag: kUnqualifiedId) {
Leaf @0 (#SymbolIdentifier @44-48: "uint")
}
Node @3 (tag: kPackedDimensions) {
}
}
Leaf @2 (#SymbolIdentifier @49-50: "x")
Leaf @3 (#'=' @51-52: "=")
Node @4 (tag: kExpression) {
Node @0 (tag: kNumber) {
Leaf @0 (#TK_DecNumber @53-54: "0")
}
}
}
}
Leaf @1 (#';' @54-55: ";")
So I believe this was fixed by https://github.com/google/verible/commit/259321c5bb95882d2ac872ca03de6c8d35fca733
I'll update a test to cover this.
Describe the bug
uint is parsed as
kReferenceCallBase
and not askDataTypePrimitive
inkForInitialization
.To Reproduce
Actual behavior:
Current CST:
Expected behavior
Expected CST: