[Lldb-commits] [lldb] [LLDB] Add Lexer (with tests) for DIL (Data Inspection Language). (PR #123521)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 31 02:21:24 PST 2025
https://github.com/labath commented:
Apart from the (mainly stylistic) inline comments, the biggest problem I see is that the definition of an identifier is still too narrow. The restriction on the dollar sign is completely unnecessary as C will let you put that [anywhere](https://godbolt.org/z/o7qbfeWve). And it doesn't allow any non-ascii characters.
I really think this should be based on an deny- rather than an allow-list. Any character we don't claim for ourselves should be fair game for an identifier. If someone manages to enter the backspace character (`\x7f`) into the expression, then so be it.
The question of "identifiers" starting with digits is interesting. Personally, I think it'd be fine to reject those (and require the currenly-vapourware quoting syntax), because I suspect you want to accept number suffixes, and I think it'd be confusing to explain why `123x` is a valid identifier but `123u` is not, but I suspect some might have a different opinion.
We could continue discussing that here, or we could accept everything here, and postpone this discussion for the patch which starts parsing numbers. Up to you..
https://github.com/llvm/llvm-project/pull/123521
More information about the lldb-commits
mailing list