diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-07-02 05:13:16 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-07-02 05:13:16 +0000 |
commit | 2e8eada098c43e53c79a2aa9a4627267006b9a26 (patch) | |
tree | 00b22ccf1f884bdbbeaaf8ab9e9e912afde5007f /usr/local/www/code-syntax-highlighter/shBrushDelphi.js | |
parent | 540b0ca74bc19669c7e03c65c1e62a5795c9b232 (diff) | |
download | pfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.zip pfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.tar.gz |
Add source code highlighting support
Diffstat (limited to 'usr/local/www/code-syntax-highlighter/shBrushDelphi.js')
-rw-r--r-- | usr/local/www/code-syntax-highlighter/shBrushDelphi.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/usr/local/www/code-syntax-highlighter/shBrushDelphi.js b/usr/local/www/code-syntax-highlighter/shBrushDelphi.js new file mode 100644 index 0000000..efb0601 --- /dev/null +++ b/usr/local/www/code-syntax-highlighter/shBrushDelphi.js @@ -0,0 +1,31 @@ +/* Delphi brush is contributed by Eddie Shipman */ +dp.sh.Brushes.Delphi = function() +{ + var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + + 'case char class comp const constructor currency destructor div do double ' + + 'downto else end except exports extended false file finalization finally ' + + 'for function goto if implementation in inherited int64 initialization ' + + 'integer interface is label library longint longword mod nil not object ' + + 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + + 'pint64 pointer private procedure program property pshortstring pstring ' + + 'pvariant pwidechar pwidestring protected public published raise real real48 ' + + 'record repeat set shl shortint shortstring shr single smallint string then ' + + 'threadvar to true try type unit until uses val var varirnt while widechar ' + + 'widestring with word write writeln xor'; + + this.regexList = [ + { regex: new RegExp('\\(\\*[\\s\\S]*?\\*\\)', 'gm'), css: 'comment' }, // multiline comments (* *) + { regex: new RegExp('{(?!\\$)[\\s\\S]*?}', 'gm'), css: 'comment' }, // multiline comments { } + { regex: new RegExp('//.*$', 'gm'), css: 'comment' }, // one line + { regex: new RegExp('\'(?:\\.|[^\\\'\'])*\'', 'g'), css: 'string' }, // strings + { regex: new RegExp('\\{\\$[a-zA-Z]+ .+\\}', 'g'), css: 'directive' }, // Compiler Directives and Region tags + { regex: new RegExp('\\b[\\d\\.]+\\b', 'g'), css: 'number' }, // numbers 12345 + { regex: new RegExp('\\$[a-zA-Z0-9]+\\b', 'g'), css: 'number' }, // numbers $F5D3 + { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.CssClass = 'dp-delphi'; +} + +dp.sh.Brushes.Delphi.prototype = new dp.sh.Highlighter(); +dp.sh.Brushes.Delphi.Aliases = ['delphi', 'pascal']; |