Skip to content

Commit

Permalink
Oracle PLSQL lexer (suitable for Oracle SQL as well) (#1811)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lee-lindley committed May 2, 2022
1 parent e76cde4 commit ee5c935
Show file tree
Hide file tree
Showing 5 changed files with 718 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Languages.md
Expand Up @@ -144,6 +144,7 @@
- PHP (`php`)
- Plain Text (`plaintext`)
- Plist (`plist`)
- PLSQL (`plsql`)
- Pony (`pony`)
- PostScript (`postscript`)
- powershell (`powershell`)
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/demos/plsql
@@ -0,0 +1,2 @@
SELECT q'{a quoted string}' AS s, TO_CHAR(SYSDATE,'MM/DD/YYYY') AS "Current Date" FROM DUAL
WHERE 1=1;

0 comments on commit ee5c935

Please sign in to comment.