feat: require escaping keyword names
x.and(y) now needs to be
x.`and`(y)
Concerns and missing things:
- Should it be an error to escape a non-keyword?
- Static fields and methods cannot use escapes (
Hello.thingis parsed in general, before knowing whether it is a java thing)
Fixes #10002 Fixes #9213
PR Lexer: 216,1 ms (06,9%) Master Lexer: 193,3 ms (06,2%)
I don't see why the lexer would be slower, seems weird
@mlutze Can you review and then I will?
I'm not sure this should be merged as is - we should probably think about static names. and what about importing MyClass.{and => myAnd} fx
We should figure out all the places where keyword escapes are needed
Hmm. True.
You cannot import methods though
Ah okay, so its mostly Math.and or whatever might static things there might be
Marked as draft until completed.
String.trim is parsed the same as System.out - allowing static Java things to use escapes means we must allow all(?) QNames to use escapes and then later (after knowing the types) disallow escaping Flix names.
This still alive?
I guess so yeah
My impression is that a clean design is needed... and then some manpower to implement it.
Could be part of a lexer re-implementation.