bscan / RakuNavigator

Raku language support and language server
MIT License
51 stars 3 forks source link

Only Parse Raku Code Once Instead of Twice #6

Open bscan opened 2 years ago

bscan commented 2 years ago

To syntax check a file, navigator.raku parses the code with nqp and also compiles it. I need the parsed output because of the is helpful for identifying the end of subs and class declaration. However, compilation is also important because of additional checks that happen in the optimize phase (e.g. subroutine signature mismatches). Currently, I am parsing the code twice which is slow and results in use statements being evaluated twice. I would like to update this code to compile only once, while still returning the $parsed code. https://github.com/bscan/RakuNavigator/blob/master/server/src/raku/navigator.raku