orbitalquark / scintillua

Scintillua enables Scintilla lexers to be written in Lua, particularly using LPeg. It can also be used as a standalone Lua library for syntax highlighting support.
https://orbitalquark.github.io/scintillua
MIT License
52 stars 22 forks source link

Convert Perl lexer to new format #80

Closed snoopy closed 2 years ago

snoopy commented 2 years ago

I've converted the Perl lexer to the new format. Based on my quick testing it seems to work fine. Could you please have a look as well?

orbitalquark commented 2 years ago

Thank you! I will take a look when I have some time. Sorry for the delay.

snoopy commented 2 years ago

[...] Does Perl have any built-in constants worth adding? This would be a good opportunity to do so. Otherwise, no problem.

Not that I know of unless you count special vars (https://perldoc.perl.org/variables). They are not really constant though.

orbitalquark commented 2 years ago

Can we use lexer.VARIABLE_BUILTIN for those? I think that will be useful. Maybe not all of them, but some useful subset, mainly so that the word list exists and other users can extend it to their liking.

snoopy commented 2 years ago

Variables are a bit spotty. LMK if there are any obvious mistakes.

snoopy commented 2 years ago

Something is still wrong with the function/string rules. I'll try to figure it out.

snoopy commented 2 years ago

Functions should work better now. The variables are still having problems where some of them don't get detected properly. The rules are probably not quite right.

What kind of changes should be made to the marker rule?

orbitalquark commented 2 years ago

The marker rule should still mark __DATA__ or __END__ followed by anything after as a comment, just like before.

snoopy commented 2 years ago

Thanks for the pointers. Seems to work fine now.

orbitalquark commented 2 years ago

Thank you! Committed with some minor formatting changes via https://github.com/orbitalquark/scintillua/commit/ce13dedf4a0d7427e3063271d7c8ca89c0530f16