tools
tools copied to clipboard
📎 Utilities to access the value of literals
Description
Currently the syntax tree only allows access to the textual value of nodes and tokens. For a variety of formatting and analysis purpose it might be useful to access the string value of a string literal (with the escape sequences interpreted) or mathematical value of a numeric literal.
Should we track this in #1996 ?
It's not directly related to the formatter, at least until we decide to rewrite literals. This is more of a general purpose, nice-to-have utility but is obviously very low priority until we have an actual use case for it.