Chevrotain / chevrotain

Parser Building Toolkit for JavaScript
https://chevrotain.io
Apache License 2.0
2.44k stars 199 forks source link

Convenient way to track rule location in EmbeddedActionsParser #2002

Closed hackwaly closed 7 months ago

hackwaly commented 7 months ago

There's outputCst and nodeLocationTracking: "full" | "onlyOffset" | "none" for CstParser. But how can I track locations for rules in EmbeddedActionsParser?

msujew commented 7 months ago

@hackwaly The IToken instances you get back from CONSUME calls contain all the tracking information. I.e. offsets, line and column positions.