R: a better lexer to CudaText
Posted: 07.05.2024 19:36
Good morning.
R's current lexer for CudaText may be much better than what is currently available. I'm trying to do it, but I need initial help from more experienced CudaText developers.
The basic problem is that a large number of functions and other objects in R have symbols ('.' and '_') in the middle of the character string. for example:
It also needs to be case dependent, as the two objects below are different things:
Objects can have letters and numbers:
Anyway, R is a very verbose language!
I know regular expressions, but I'm not aware of the flavor that is used in the construction of current lexers. I think it's Python, but it doesn't match up well with the Python tests from REGEX101 (https://regex101.com/) that I use to test and document the regular expressions I make.
I am attaching a file (Tinn-R_recognized_words.R) from the Tinn-R editor (https://sourceforge.net/projects/tinn-r/) that contains a sample of how I intend to build the new R lexer for CudaText, if possible.
Please, can someone help me until I understand the process of creating a lexer in Cuda?
I've read all the documentation, I'm really missing the practice...
R's current lexer for CudaText may be much better than what is currently available. I'm trying to do it, but I need initial help from more experienced CudaText developers.
The basic problem is that a large number of functions and other objects in R have symbols ('.' and '_') in the middle of the character string. for example:
Code: Select all
- all.equal.character
- anyNA.numeric_version
- as.data.frame.numeric_version
- aspell_package_vignettes
Code: Select all
- LETTERS
- letters
Code: Select all
- state.x77
- CO2
- co2
I know regular expressions, but I'm not aware of the flavor that is used in the construction of current lexers. I think it's Python, but it doesn't match up well with the Python tests from REGEX101 (https://regex101.com/) that I use to test and document the regular expressions I make.
I am attaching a file (Tinn-R_recognized_words.R) from the Tinn-R editor (https://sourceforge.net/projects/tinn-r/) that contains a sample of how I intend to build the new R lexer for CudaText, if possible.
Please, can someone help me until I understand the process of creating a lexer in Cuda?
I've read all the documentation, I'm really missing the practice...