summaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2020-07-16 10:24:08 +0100
committerliamfallon <liam.fallon@est.tech>2020-07-17 14:46:26 +0100
commit2de08a64e959788f288d82cd4410fee9424a11bc (patch)
tree93d90b4de43e6e52c7059e842cf8c5ba4d10ecca /gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js
parentee41415476b6ea1775a2f689eecb8713abf81f0c (diff)
Move apex policy editor to policy-gui
This review moves the code for the apex policy editor from the apex repo to the GUI repo. The docker part of the build will be moved in the next review because it is intertwined with the other two legacy apex GUIs and needs to be disentangled. Subsequent reviews on the apex repo will remove this code from there. Issue-ID: POLICY-2621 Change-Id: Ib9a43f463b839201656208a48ab48869a19f963a Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js')
-rw-r--r--gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js88
1 files changed, 88 insertions, 0 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js
new file mode 100644
index 0000000..0313c0c
--- /dev/null
+++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/edit_area/reg_syntax/perl.js
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
+ *
+ * You may choose any license of the current release or any future release
+ * of editarea to use, modify and/or redistribute this file.
+ *
+ * This language specification file supports for syntax checking on
+ * a large subset of Perl 5.x.
+ * The basic common syntax of Perl is fully supported, but as for
+ * the highlighting of built-in operations, it's mainly designed
+ * to support for hightlighting Perl code in a Safe environment (compartment)
+ * as used by CoMaNet for evaluation of administrative scripts. This Safe
+ * compartment basically allows for all of Opcode's :default operations,
+ * but little others. See http://perldoc.perl.org/Opcode.html to learn
+ * more.
+ ***************************************************************************/
+
+editAreaLoader.load_syntax["perl"] = {
+ 'DISPLAY_NAME' : 'Perl',
+ 'COMMENT_SINGLE' : {1 : '#'},
+ 'QUOTEMARKS' : {1: "'", 2: '"'},
+ 'KEYWORD_CASE_SENSITIVE' : true,
+ 'KEYWORDS' :
+ {
+ 'core' :
+ [ "if", "else", "elsif", "while", "for", "each", "foreach",
+ "next", "last", "goto", "exists", "delete", "undef",
+ "my", "our", "local", "use", "require", "package", "keys", "values",
+ "sub", "bless", "ref", "return" ],
+ 'functions' :
+ [
+ //from :base_core
+ "int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
+ "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
+ "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
+ "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
+ "xor", "warn", "die", "prototype",
+ //from :base_mem
+ "concat", "repeat", "join", "range",
+ //none from :base_loop, as we'll see them as basic statements...
+ //from :base_orig
+ "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
+ //others
+ "print", "open", "close"
+ ]
+ },
+ 'OPERATORS' :
+ [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
+ ' eq ', ' ne ', '=~' ],
+ 'DELIMITERS' :
+ [ '(', ')', '[', ']', '{', '}' ],
+ 'REGEXPS' :
+ {
+ 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
+ 'class' : 'scopingnames',
+ 'modifiers' : 'g', 'execute' : 'before' },
+ 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
+ 'class' : 'scopingnames',
+ 'modifiers' : 'g', 'execute' : 'before' },
+ 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
+ 'class' : 'vars',
+ 'modifiers' : 'g', 'execute' : 'after' },
+ },
+
+ 'STYLES' :
+ {
+ 'COMMENTS': 'color: #AAAAAA;',
+ 'QUOTESMARKS': 'color: #DC0000;',
+ 'KEYWORDS' :
+ {
+ 'core' : 'color: #8aca00;',
+ 'functions' : 'color: #2B60FF;'
+ },
+ 'OPERATORS' : 'color: #8aca00;',
+ 'DELIMITERS' : 'color: #0038E1;',
+ 'REGEXPS':
+ {
+ 'scopingnames' : 'color: #ff0000;',
+ 'vars' : 'color: #00aaaa;',
+ }
+ } //'STYLES'
+};