antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.24k stars 3.72k forks source link

[CSharp] cannot parse open telemetry demo ValkeyCartStore.cs #4298

Open talwgx opened 3 weeks ago

talwgx commented 3 weeks ago

The CSharp grammar fails to parse:

https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/cartservice/src/cartstore/ValkeyCartStore.cs

This is due to lines 11 and 22 using newer language constructs (namespace and new(); ). Even though the grammar states it only supports C# up to v6.0 it'll be great if those constructs are supported or even ignored as otherwise parsing of the entire file fails.