microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
233 stars 54 forks source link

Update ANTLR lexer and grammar #123

Closed yjt98765 closed 2 years ago

yjt98765 commented 2 years ago

This pull request updates the ANTLR files for describing the language grammar. It mainly contains the recent modification in the compiler repository. Some earlier modification to QSharpParser.g4 is also added to keep the consistency between these two repositories.

bettinaheim commented 2 years ago

@samarsha Could you take a quick look at this?

yjt98765 commented 2 years ago

@samarsha Sorry, I did not notice the grammar targets Java. I have updated the lines you mentioned above and generated Java files using ANTLR 4.9.2. VS Code does not report errors regarding the generated files. As a comparison, the original predicate _localctx.terminal.Text did cause an error. Although I did not execute the parser for actually parsing a Q# file, I guess the previous evidence is strong enough.