From 0fbc5583ff76cb3036a5d3833c98cfcbfabac852 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Wed, 7 Sep 2022 14:21:46 +0200 Subject: [PATCH] Fixing the 'Spread types' error Signed-off-by: Martin Zeithaml --- .../editor/code-editor/monaco/hiliters/jcl.ts | 153 +++++++++--------- 1 file changed, 76 insertions(+), 77 deletions(-) diff --git a/webClient/src/app/editor/code-editor/monaco/hiliters/jcl.ts b/webClient/src/app/editor/code-editor/monaco/hiliters/jcl.ts index d546fa76..10fc22ef 100644 --- a/webClient/src/app/editor/code-editor/monaco/hiliters/jcl.ts +++ b/webClient/src/app/editor/code-editor/monaco/hiliters/jcl.ts @@ -1,4 +1,4 @@ -const jclDebug = false; +const jclDebug = ''; //Null, undefined or empty string for production environment const JCL_KEYWORDS = '(CNTL|DD|EXEC|EXPORT|JOB|INCLUDE|JCLLIB|OUTPUT|PROC|SCHEDULE|SET|XMIT|COMMAND|JOBGROUP|\ GJOB|JOBSET|SJOB|ENDSET|AFTER|BEFORE|CONCURRENT|ENDGROUP)'; @@ -11,7 +11,6 @@ export const JCL_HILITE = { brackets: [ ['(',')','jcl-delimiter'], ], - // Expand tokenizer via: https://microsoft.github.io/monaco-editor/monarch.html // Logging for debugging: @@ -21,106 +20,106 @@ export const JCL_HILITE = { // o '$0' - shows the regex match tokenizer: { root: [ - [/^\/\/\*.*$/, {token: 'jcl-comment', ...jclDebug && {log: '[$S0] -> --- \'$0\''}} ], //Comment begins with //*, lasts until end of line - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for ',' + linenumber + linebreak (continuation of statement) - [/( *)[0-9]+$/, { token: 'jcl-default', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //Checks for linenumber + linebreak (new JCL statement) - [/( +)/, { token: 'whitespace', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //Removes any previous line spaces - [/^\/\*[ ]*$/, { token: 'jcl-statement', ...jclDebug && {log: '[$S0] -> ---' }}], //Starts with /* followed by end or spaces and end - [/^\/\*[ ]/, { token: 'jcl-statement', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], //Statements begin with /*space ... - [/^\/\*/, { token: 'jcl-statement', next: '@nameFirstChar', ...jclDebug && {log: '[$S0] -> nameFirstChar \'$0\'' }}], //Statements begin with /* ... - [/^\/\//, { token: 'jcl-statement', next: '@nameFirstChar', ...jclDebug && {log: '[$S0] -> nameFirstChar \'$0\'' }}], // or // - [/.*/, { token: 'jcl-none', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //When a token doesn't match, the line is blue + [/^\/\/\*.*$/, {token: 'jcl-comment', log: jclDebug && '[$S0] -> --- \'$0\''} ], //Comment begins with //*, lasts until end of line + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for ',' + linenumber + linebreak (continuation of statement) + [/( *)[0-9]+$/, { token: 'jcl-default', log: jclDebug && '[$S0] -> --- \'$0\'' }], //Checks for linenumber + linebreak (new JCL statement) + [/( +)/, { token: 'whitespace', log: jclDebug && '[$S0] -> --- \'$0\'' }], //Removes any previous line spaces + [/^\/\*[ ]*$/, { token: 'jcl-statement', log: jclDebug && '[$S0] -> ---' }], //Starts with /* followed by end or spaces and end + [/^\/\*[ ]/, { token: 'jcl-statement', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], //Statements begin with /*space ... + [/^\/\*/, { token: 'jcl-statement', next: '@nameFirstChar', log: jclDebug && '[$S0] -> nameFirstChar \'$0\'' }], //Statements begin with /* ... + [/^\/\//, { token: 'jcl-statement', next: '@nameFirstChar', log: jclDebug && '[$S0] -> nameFirstChar \'$0\'' }], // or // + [/.*/, { token: 'jcl-none', log: jclDebug && '[$S0] -> --- \'$0\'' }], //When a token doesn't match, the line is blue ], nameFirstChar: [ - [/[ ]/, { token: 'jcl-default', next: '@operator', ...jclDebug && {log: '[$S0] -> operator \'$0\'' }}], //Name must start with capital or national symbols - [/[A-Z|@|#|$| ]/, { token: 'jcl-default', next: '@name', ...jclDebug && {log: '[$S0] -> name \'$0\'' }}], //Name must start with capital or national symbols (space is for 1 letter label) - [/./, { token: 'jcl-invalid', next: '@name', ...jclDebug && {log: '[$S0] -> name \'$0\'' }}], //For everything else + [/[ ]/, { token: 'jcl-default', next: '@operator', log: jclDebug && '[$S0] -> operator \'$0\'' }], //Name must start with capital or national symbols + [/[A-Z|@|#|$| ]/, { token: 'jcl-default', next: '@name', log: jclDebug && '[$S0] -> name \'$0\'' }], //Name must start with capital or national symbols (space is for 1 letter label) + [/./, { token: 'jcl-invalid', next: '@name', log: jclDebug && '[$S0] -> name \'$0\'' }], //For everything else ], name: [ - [/[A-Z|@|#|$|\.|0-9]{0,16}/, { token: 'jcl-default', next: '@invalidName', ...jclDebug && {log: '[$S0] -> invalidName \'$0\'' }}], //Name must be between {0, 16} characters - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for ',' + linenumber + linebreak (continuation of statement) - [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for linenumber + linebreak (new JCL statement) - [/( +)/, { token: 'whitespace', next: '@operator', ...jclDebug && {log: '[$S0] -> operator \'$0\'' }}], //Spaces(s) designate when to check for operator keywords after name - [/'.*'/, { token: 'jcl-string', next: '@strings', ...jclDebug && {log: '[$S0] -> string \'$0\'' }}], - [/[^A-Z|@|#|$|0-9]/, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> ---\'$0\'' }}], // Checks for invalid JCL characters in names - [/./, { token: 'jcl-default', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}] + [/[A-Z|@|#|$|\.|0-9]{0,16}/, { token: 'jcl-default', next: '@invalidName', log: jclDebug && '[$S0] -> invalidName \'$0\'' }], //Name must be between {0, 16} characters + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for ',' + linenumber + linebreak (continuation of statement) + [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for linenumber + linebreak (new JCL statement) + [/( +)/, { token: 'whitespace', next: '@operator', log: jclDebug && '[$S0] -> operator \'$0\'' }], //Spaces(s) designate when to check for operator keywords after name + [/'.*'/, { token: 'jcl-string', next: '@strings', log: jclDebug && '[$S0] -> string \'$0\'' }], + [/[^A-Z|@|#|$|0-9]/, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> ---\'$0\'' }], // Checks for invalid JCL characters in names + [/./, { token: 'jcl-default', log: jclDebug && '[$S0] -> --- \'$0\'' }] ], invalidName: [ - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/( +)/, { token: 'jcl-invalid', next: '@operator', ...jclDebug && {log: '[$S0] -> operator \'$0\'' }}], //Name must be between {0, 8} characters - [/./, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //Name must be between {0, 8} characters + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/( +)/, { token: 'jcl-invalid', next: '@operator', log: jclDebug && '[$S0] -> operator \'$0\'' }], //Name must be between {0, 8} characters + [/./, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> --- \'$0\'' }], //Name must be between {0, 8} characters ], operator: [ - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/!/, { token: 'jcl-invalid', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], // Checks for invalid JCL characters - [/[a-z]+/, { token: 'jcl-invalid', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], // Checks for invalid lowercase JCL - [/(,|&|=|\^)/, { token: 'jcl-delimiter', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], - [/'/, { token: 'jcl-string', next: '@strings', ...jclDebug && {log: '[$S0] -> string \'$0\'' }}], + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/!/, { token: 'jcl-invalid', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], // Checks for invalid JCL characters + [/[a-z]+/, { token: 'jcl-invalid', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], // Checks for invalid lowercase JCL + [/(,|&|=|\^)/, { token: 'jcl-delimiter', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], + [/'/, { token: 'jcl-string', next: '@strings', log: jclDebug && '[$S0] -> string \'$0\'' }], [/[()]/, '@brackets' ], - [/(IF)/, { token: 'jcl-operator', next: '@if', ...jclDebug && {log: '[$S0] -> if \'$0\'' }}], //If is special, gets its own logic - [new RegExp(JCL_KEYWORDS + " *$"), { token: 'jcl-operator', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], - [new RegExp(JCL_KEYWORDS + " +"), { token: 'jcl-operator', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], - [new RegExp(JCL_KEYWORDS_SPECIAL + " *$"), { token: 'jcl-operator', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], - [new RegExp(JCL_KEYWORDS_SPECIAL + " +"), { token: 'jcl-operator', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], - [/[^\s\\a-z(,|&|=|\^)]+/, { token: 'jcl-default', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], //Matches the rest + [/(IF)/, { token: 'jcl-operator', next: '@if', log: jclDebug && '[$S0] -> if \'$0\'' }], //If is special, gets its own logic + [new RegExp(JCL_KEYWORDS + " *$"), { token: 'jcl-operator', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], + [new RegExp(JCL_KEYWORDS + " +"), { token: 'jcl-operator', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], + [new RegExp(JCL_KEYWORDS_SPECIAL + " *$"), { token: 'jcl-operator', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], + [new RegExp(JCL_KEYWORDS_SPECIAL + " +"), { token: 'jcl-operator', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], + [/[^\s\\a-z(,|&|=|\^)]+/, { token: 'jcl-default', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], //Matches the rest ], if: [ - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/(THEN )/, { token: 'jcl-operator', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], - [/./, { token: 'jcl-variable', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/(THEN )/, { token: 'jcl-operator', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], + [/./, { token: 'jcl-variable', log: jclDebug && '[$S0] -> --- \'$0\'' }], ], operands: [ - [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for ',' + linenumber + linebreak (continuation of statement) - [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for linenumber + linebreak (new JCL statement) - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/, /, { token: 'jcl-delimiter', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], //Checks for , + space (leads to comment) - [/'/, { token: 'jcl-string', next: '@strings', ...jclDebug && {log: '[$S0] -> string \'$0\'' }}], - [/!/, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], // Checks for invalid JCL characters - [/[a-z]+/, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], // Checks for invalid lowercase JCL - [/(,|&|=|\^)/, { token: 'jcl-delimiter', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], - [/[)]$/, {token: 'jcl-delimiter', next:'@popall', ...jclDebug && {log: '[$S0] -> popall' }}], + [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for ',' + linenumber + linebreak (continuation of statement) + [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for linenumber + linebreak (new JCL statement) + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/, /, { token: 'jcl-delimiter', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], //Checks for , + space (leads to comment) + [/'/, { token: 'jcl-string', next: '@strings', log: jclDebug && '[$S0] -> string \'$0\'' }], + [/!/, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> --- \'$0\'' }], // Checks for invalid JCL characters + [/[a-z]+/, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> --- \'$0\'' }], // Checks for invalid lowercase JCL + [/(,|&|=|\^)/, { token: 'jcl-delimiter', log: jclDebug && '[$S0] -> --- \'$0\'' }], + [/[)]$/, {token: 'jcl-delimiter', next:'@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], [/[()]/, '@brackets' ], - [/ /, { token: 'jcl-variable', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}],//Space leads to comments - [/\*$/, { token: 'jcl-variable', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //(*) as last char - [/.$/, { token: 'jcl-variable', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //For end - [/./, { token: 'jcl-variable', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //For everything else + [/ /, { token: 'jcl-variable', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }],//Space leads to comments + [/\*$/, { token: 'jcl-variable', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //(*) as last char + [/.$/, { token: 'jcl-variable', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //For end + [/./, { token: 'jcl-variable', log: jclDebug && '[$S0] -> --- \'$0\'' }], //For everything else ], operands2: [ //JCL has a behavior where it will accept two sets of operands before detecting comments //for certain conditions, usually when statements are continued via a ',' - [/, *$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for end of line with a ',' - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for end of line without a ',' - [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', ...jclDebug && {log: '[$S0] -> operands2 \'$0\'' }}], //Checks for ',' + linenumber + linebreak (continuation of statement) - [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], //Checks for linenumber + linebreak (new JCL statement) - [/, /, { token: 'jcl-delimiter', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], //Checks for , + space (leads to comment) - [/'/, { token: 'jcl-string', next: '@strings', ...jclDebug && {log: '[$S0] -> string \'$0\'' }}], - [/!/, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], // Checks for invalid JCL characters - [/[a-z]+/, { token: 'jcl-invalid', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], // Checks for invalid lowercase JCL - [/(,|&|=|\^)/, { token: 'jcl-delimiter', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], + [/, *$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for end of line with a ',' + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for end of line without a ',' + [/,( +)[0-9]+$/, { token: 'jcl-delimiter', next: '@operands2', log: jclDebug && '[$S0] -> operands2 \'$0\'' }], //Checks for ',' + linenumber + linebreak (continuation of statement) + [/( *)[0-9]+$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], //Checks for linenumber + linebreak (new JCL statement) + [/, /, { token: 'jcl-delimiter', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], //Checks for , + space (leads to comment) + [/'/, { token: 'jcl-string', next: '@strings', log: jclDebug && '[$S0] -> string \'$0\'' }], + [/!/, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> --- \'$0\'' }], // Checks for invalid JCL characters + [/[a-z]+/, { token: 'jcl-invalid', log: jclDebug && '[$S0] -> --- \'$0\'' }], // Checks for invalid lowercase JCL + [/(,|&|=|\^)/, { token: 'jcl-delimiter', log: jclDebug && '[$S0] -> --- \'$0\'' }], [/[()]/, '@brackets' ], - [/ +/, { token: 'jcl-variable', next: '@operands', ...jclDebug && {log: '10. [$S0] -> operands \'$0\'' }}],//Space leads to next operand - [/\//, { token: 'jcl-variable', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], - [/^.*/, { token: 'jcl-none', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], //When a token doesn't match, the line is blue - [/./, { token: 'jcl-variable', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}],//For everything else + [/ +/, { token: 'jcl-variable', next: '@operands', log: jclDebug && '10. [$S0] -> operands \'$0\'' }],//Space leads to next operand + [/\//, { token: 'jcl-variable', log: jclDebug && '[$S0] -> --- \'$0\'' }], + [/^.*/, { token: 'jcl-none', log: jclDebug && '[$S0] -> --- \'$0\'' }], //When a token doesn't match, the line is blue + [/./, { token: 'jcl-variable', log: jclDebug && '[$S0] -> --- \'$0\'' }],//For everything else ], comments: [ - [/.*/, { token: 'jcl-comment', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], - [/ *\n| *$/, { token: 'jcl-default', next: '@popall', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], + [/.*/, { token: 'jcl-comment', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], + [/ *\n| *$/, { token: 'jcl-default', next: '@popall', log: jclDebug && '[$S0] -> --- \'$0\'' }], ], strings: [ //Strings get their own category because Monaco doesn't seem to deal with pattern matching //over line breaks, even with multiline flags. This way, we just put strings into their own loop. - [/.*' *$/, { token: 'jcl-string', next: '@popall', ...jclDebug && {log: '[$S0] -> popall \'$0\'' }}], // (') character ending line -> we are done here - [/.*' /, { token: 'jcl-string', next: '@comments', ...jclDebug && {log: '[$S0] -> comments \'$0\'' }}], // Space after the ending (') character is a comment - [/.*' */, { token: 'jcl-string', next: '@operands', ...jclDebug && {log: '[$S0] -> operands \'$0\'' }}], // Covers all characters in string until ending (') character - [/.*/, { token: 'jcl-string', ...jclDebug && {log: '[$S0] -> --- \'$0\'' }}], + [/.*' *$/, { token: 'jcl-string', next: '@popall', log: jclDebug && '[$S0] -> popall \'$0\'' }], // (') character ending line -> we are done here + [/.*' /, { token: 'jcl-string', next: '@comments', log: jclDebug && '[$S0] -> comments \'$0\'' }], // Space after the ending (') character is a comment + [/.*' */, { token: 'jcl-string', next: '@operands', log: jclDebug && '[$S0] -> operands \'$0\'' }], // Covers all characters in string until ending (') character + [/.*/, { token: 'jcl-string', log: jclDebug && '[$S0] -> --- \'$0\'' }], ] } };