Skip to content

error generate cpp lexer #81

Description

@heruhday

I tried to generate cpp lexer from https://github.com/antlr/grammars-v4/blob/master/cpp/pom.xml, but have a error like:
error: expected {, found throw
I think the problem is throw because rust not using throw new like java or C# for error handling.

 --> src\cpp\cpp14parser.rs:23478:64
  |

23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| ^^^^^ expected {
|
note: the if expression is missing a block after this condition
--> src\cpp\cpp14parser.rs:23477:6
|
23477 | if(if let Some(it) = &(cast::<_,PureSpecifierContext >(&*_localctx))
| ^
23478 | | .val { it.get_text() } else { "null" } .compareTo("0")!=0) throw new InputMismatchException(this);
| |
________________________________________________________^
help: try placing this code inside a block
|
23478 | .val { it.get_text() } else { "null" } .compareTo("0")!=0) { throw } new InputMismatchException(this);
| + +

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions