Skip to content

Parser misbehaving in cases like GenericStruct1<GenericStruct2<int>>. #40

@Nyvyme

Description

@Nyvyme

Lexer always treats >> as a shift left, but the parser expects two separate >s.

The easiest fix is to check in lexer if character after >> is >, : or ).
This will fix the error in cases like this: test: int = sizeof(GenericStruct1<GenericStruct2<int>>);,
but it will not fix the issue in cases like test: GenericStruct1<GenericStruct2<int>> = ....

Probably need to get rid of <<, >>, <<= and >>= as a token in lexer, but how do we combine them into shls, shrs, etc. when we actually need those? Because parser (I guess we have to do this in parser, I don't actually know) does not know anything about spaces. Need to investigate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions