https://github.com/llvm-beanz commented:

In general I think this is very much moving in the right direction. I have two 
high level areas of feedback (see my more specific comments inline).

In general, Lexer's don't often have the context to provide actionable error 
messages. As a result it is _usually_ better for the Lexer to push up an 
invalid token to the parser and allow the parser to provide a more contextually 
relevant diagnostic.

The other area is around what is the responsibility of the parser vs the lexer. 
In general lexers just break the input into tokens, the parser then interprets 
and validates the tokens. In particular around numbers this is doing a lot of 
interpretation of the token values. I think it is probably better to have a 
clearer separation.

https://github.com/llvm/llvm-project/pull/122981
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to