Raku Lexer
Raku Lexer
Hi!
I added some keywords to the raku lexer. Don't know if they are in the right place, though....
I also changed the displaying types in the code browser, because it's possible to put comments in the signature and it will make the display unusable.
The lcf file is attached.
Another thing that i did was a linter for raku. You can find the source for it in: https://github.com/demanuel/cuda_lint_raku
Please confirm that everything's fine.
I added some keywords to the raku lexer. Don't know if they are in the right place, though....
I also changed the displaying types in the code browser, because it's possible to put comments in the signature and it will make the display unusable.
The lcf file is attached.
Another thing that i did was a linter for raku. You can find the source for it in: https://github.com/demanuel/cuda_lint_raku
Please confirm that everything's fine.
- Attachments
-
- Raku.lcf.tar.gz
- raku lcf file
- (4.01 KiB) Downloaded 229 times
-
- Posts: 392
- Joined: 01.12.2020 13:46
-
- Posts: 392
- Joined: 01.12.2020 13:46
New version attached.
The only issue i see is with the code
in the code tree for the sub rule it becomes
How do i make it
?
The only issue i see is with the code
Code: Select all
grammar Calculator {
token TOP { [ <add> | <sub> ] }
rule add { <num> '+' <num> }
rule sub { <num> '-' <num> }
token num { \d+ }
}
Code: Select all
gramar Calculator
token TOP
rule add
sub {
token num
Code: Select all
gramar Calculator
token TOP
rule add
rule sub
token num
- Attachments
-
- Raku.lcf.tar.gz
- (4.03 KiB) Downloaded 205 times
-
- Posts: 392
- Joined: 01.12.2020 13:46
1. I can fix it but need to know: are all these words- keywords, and must be bold-black (default theme)?
class
grammar
method
model
module
monitor
package
proto
regex
role
rule
sub
submethod
token
2. if 'sub' is keyword, then this line is bad?
token TOP { [ <add> | <sub> ] }
and this?
rule sub { <num> '-' <num> }
or 'sub' is not always a keyword?
class
grammar
method
model
module
monitor
package
proto
regex
role
rule
sub
submethod
token
2. if 'sub' is keyword, then this line is bad?
token TOP { [ <add> | <sub> ] }
and this?
rule sub { <num> '-' <num> }
or 'sub' is not always a keyword?
-
- Posts: 392
- Joined: 01.12.2020 13:46
The example is correct. sub is not always a keyword.uvviewsoft wrote:3. Can i consider all these words as keywords IF the next 'token' is identifier?
'sub Id' = here 'sub' is keyword?
'rule sub { ... }' = here 'sub' is not keyword?
This is valid code with the sub as the name of the rule: https://docs.raku.org/language/grammars ... to_regexes
Code: Select all
grammar Calculator {
token TOP { [ <add> | <sub> ] }
rule add { <num> '+' <num> }
rule sub { <num> '-' <num> }
token num { \d+ }
}
Last edited by demanuel on 01.06.2021 12:15, edited 1 time in total.
-
- Posts: 392
- Joined: 01.12.2020 13:46
H, uvviewsoft,
I updated the https://github.com/demanuel/cuda_lint_raku however i'm unable to create a PR as your repo is a fork of mine
I updated the https://github.com/demanuel/cuda_lint_raku however i'm unable to create a PR as your repo is a fork of mine
