-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oracle PLSQL lexer (suitable for Oracle SQL as well) #1811
Conversation
restrict words after dot to functions or regular names instead of keywords
…tion. Add comments to lexer code and pretty it up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution and hard work @lee-lindley ❤️ The PR looks great to me overall 👍🏼 I have added some suggestions/questions for your consideration.
- Could we ensure 2 space indentation on the
lib/rouge/lexers/psql.rb
file? There seem to be some mixed 2 and 4 space indentations on the file. - Could we add an entry on the
docs/Languages.md
file for this new lexer?
Please let me know what you think 🙏🏼 .
ensure 2 space indentation throughout correct spelling errors in comments change keywords to keywords_reserved and keywords_nresvd to keywords Remove redundant comments add cursor attributes to name::attribute list add optional double/float modifier letters to numeric literals, also to visual test file.
Tan, In any case I believe I addressed all suggestions appropriately, and only did small amount of functionality tweaking. I reviewed my test files visually and everything still looks good. |
Thanks a lot for your prompt action @lee-lindley 🙇🏼 Looks great to me 🚀 |
* add oracle plsql lexer * add demo and sample * tweak rules for multiline items and function/package/procedure/type creates * add type attributes, word operators, preprocessor directives * add rule for MERGE syntax to get keywords rather than names * remove trailing dot option for floating point number. restrict words after dot to functions or regular names instead of keywords * pad visual sample with more edge cases on numbers and dot method notation. Add comments to lexer code and pretty it up * added PLSQL to docs/Languages.md ensure 2 space indentation throughout correct spelling errors in comments change keywords to keywords_reserved and keywords_nresvd to keywords Remove redundant comments add cursor attributes to name::attribute list add optional double/float modifier letters to numeric literals, also to visual test file. * slight formatting tweak. remove extra space
The keywords, non-reserved keywords, types and built-in functions are from the Oracle 19c manuals.
The quoted literal parsing is much better than the existing SQL lexer, especially regarding the "q'" operator. I classify the quote delimiters as operators which is a departure from most others, but they are not part of the literal, so making them the same color as the quoted string is just wrong.
I borrowed liberally from the existing SQL, Perl and Ruby lexers and folowed the Lexer Development guide.
The demo, sample and spec files are similar to others in those directories.
My blog (http://lee-lindley.github.io) is built using this lexer.