-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for PL/SQL (Fix #1149) * Merge gh-pages
- Loading branch information
Showing
11 changed files
with
514 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Prism.languages.plsql = Prism.languages.extend('sql', { | ||
'comment': [ | ||
/\/\*[\s\S]*?\*\//, | ||
/--.*/ | ||
] | ||
}); | ||
|
||
if (Prism.util.type(Prism.languages.plsql['keyword']) !== 'Array') { | ||
Prism.languages.plsql['keyword'] = [Prism.languages.plsql['keyword']]; | ||
} | ||
Prism.languages.plsql['keyword'].unshift( | ||
/\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i | ||
); | ||
|
||
if (Prism.util.type(Prism.languages.plsql['operator']) !== 'Array') { | ||
Prism.languages.plsql['operator'] = [Prism.languages.plsql['operator']]; | ||
} | ||
Prism.languages.plsql['operator'].unshift( | ||
/:=/ | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<h2>Comments</h2> | ||
<pre><code>-- Single line comment | ||
/* Multi-line | ||
comment */</code></pre> | ||
|
||
<h2>Operators</h2> | ||
<pre><code>l_message := 'Hello ' || place_in;</code></pre> | ||
|
||
<h2>Keywords</h2> | ||
<pre><code>CREATE OR REPLACE PROCEDURE | ||
hello_place (place_in IN VARCHAR2) | ||
IS | ||
l_message VARCHAR2 (100); | ||
BEGIN | ||
l_message := 'Hello ' || place_in; | ||
DBMS_OUTPUT.put_line (l_message); | ||
END hello_place; | ||
|
||
DECLARE | ||
l_dept_id | ||
employees.department_id%TYPE := 10; | ||
BEGIN | ||
DELETE FROM employees | ||
WHERE department_id = l_dept_id; | ||
|
||
DBMS_OUTPUT.put_line (SQL%ROWCOUNT); | ||
END; | ||
|
||
DECLARE | ||
l_message VARCHAR2 (100) := 'Hello'; | ||
l_message2 VARCHAR2 (100) := ' World!'; | ||
BEGIN | ||
IF SYSDATE >= TO_DATE ('01-JAN-2011') | ||
THEN | ||
l_message2 := l_message || l_message2; | ||
DBMS_OUTPUT.put_line (l_message2); | ||
ELSE | ||
DBMS_OUTPUT.put_line (l_message); | ||
END IF; | ||
END;</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/**/ | ||
/* foo | ||
bar */ | ||
-- | ||
-- foo | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "/**/"], | ||
["comment", "/* foo\r\nbar */"], | ||
["comment", "--"], | ||
["comment", "-- foo"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
Oops, something went wrong.