diff --git a/lib/ace/mode/forth_highlight_rules.js b/lib/ace/mode/forth_highlight_rules.js index aa67ec55..31ced17b 100644 --- a/lib/ace/mode/forth_highlight_rules.js +++ b/lib/ace/mode/forth_highlight_rules.js @@ -47,29 +47,19 @@ var ForthHighlightRules = function() { this.$rules = { start: [ { include: '#forth' } ], '#comment': [ { token: 'comment.line.double-dash.forth', - regex: '(?<=^|\\s)--\\s.*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(--\\s.*$)', + regex: '(?:^|\\s)--\\s.*$', comment: 'line comments for iForth' }, { token: 'comment.line.backslash.forth', - regex: '(?<=^|\\s)\\\\[\\s\\S]*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\\\[\\s\\S]*$)', + regex: '(?:^|\\s)\\\\[\\s\\S]*$', comment: 'ANSI line comment' }, { token: 'comment.line.backslash-g.forth', - regex: '(?<=^|\\s)\\\\[Gg] .*$', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\\\[Gg] .*$)', + regex: '(?:^|\\s)\\\\[Gg] .*$', comment: 'gForth line comment' }, { token: 'comment.block.forth', - regex: '(?<=^|\\s)\\(\\*(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\(\\*)(?=\\s)', + regex: '(?:^|\\s)\\(\\*(?=\\s|$)', push: [ { token: 'comment.block.forth', - regex: '(?<=^|\\s)\\*\\)(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\*\\))(?=\\s)', + regex: '(?:^|\\s)\\*\\)(?=\\s|$)', next: 'pop' }, { defaultToken: 'comment.block.forth' } ], comment: 'multiline comments for iForth' }, @@ -84,24 +74,16 @@ var ForthHighlightRules = function() { { defaultToken: 'comment.block.documentation.forth' } ], comment: 'documentation comments for iForth' }, { token: 'comment.line.parentheses.forth', - regex: '(?<=^|\\s)\\.?\\( [^)]*\\)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(\\.?\\( [^)]*\\))', + regex: '(?:^|\\s)\\.?\\( [^)]*\\)', comment: 'ANSI line comment' } ], '#constant': [ { token: 'constant.language.forth', - regex: '(?<=^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s)', + regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:(?<=^|\\s)(TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s))' }, { token: 'constant.numeric.forth', - regex: '(?<=^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)([$#%]?[-+]?[0-9]+(\\.[0-9]*e(-?[0-9]+)|\\.?[0-9a-fA-F]*))(?=\\s)' }, + regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)', { token: 'constant.character.forth', - regex: '(?<=^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s)', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(([&^]\\S)|(("|\')\\S("|\')))(?=\\s)' } ], + regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)', '#forth': [ { include: '#constant' }, { include: '#comment' }, @@ -112,64 +94,45 @@ var ForthHighlightRules = function() { { include: '#word-def' } ], '#storage': [ { token: 'storage.type.forth', - regex: '(?<=^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s)', + regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY))(?=\\s)' } ], '#string': [ { token: 'string.quoted.double.forth', - regex: '(?:(?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|C" |0"|S\\\\?" )[^"]+"', + regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:((?<=ABORT" )|(?<=BREAK" )|(?<=\\." )|(C" )|(0")|(S\\\\?" )))[^"]+"' }, { token: 'string.unquoted.forth', - regex: '(?:(?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE))[ ]\\S+(?=\\s)', + regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?i:((?<=INCLUDE)|(?<=NEEDS)|(?<=REQUIRE)|(?<=USE)))[ ]\\S+(?=\\s)' } ], '#variable': [ { token: 'variable.language.forth', regex: '\\b(?:I|J)\\b', caseInsensitive: true } ], '#word': [ { token: 'keyword.control.immediate.forth', - regex: '(?<=^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s)', + regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)\\[(?i:(\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE))\\](?=\\s)' }, { token: 'keyword.other.immediate.forth', - regex: '(?<=^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s)', + regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|]))(?=\\s)' }, { token: 'keyword.control.compile-only.forth', - regex: '(?<=^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s)', + regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE))(?=\\s)' }, { token: 'keyword.other.compile-only.forth', - regex: '(?<=^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s)', + regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]||DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE))(?=\\s)' }, { token: 'keyword.other.non-immediate.forth', - regex: '(?<=^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s)', + regex: '(?:^|\\s)(?:\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(\'|||CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE))(?=\\s)' }, { token: 'keyword.other.warning.forth', - regex: '(?<=^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s)', + regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', caseInsensitive: true, - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=^|\\s)(?i:(~~|BREAK:|BREAK"|DBG))(?=\\s)' } ], '#word-def': [ { token: [ 'keyword.other.compile-only.forth', + 'keyword.other.compile-only.forth', 'meta.block.forth', - 'entity.name.function.forth', - 'meta.block.forth', - 'keyword.other.compile-only.forth' ], - regex: '(^:|\\s:)(\\s)(\\S+)(\\s)|(:NONAME)', + 'entity.name.function.forth' ], + regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)', caseInsensitive: true, push: [ { token: 'keyword.other.compile-only.forth', diff --git a/lib/ace/mode/html_twig_highlight_rules.js b/lib/ace/mode/html_twig_highlight_rules.js index a72ba682..2a9e57a5 100644 --- a/lib/ace/mode/html_twig_highlight_rules.js +++ b/lib/ace/mode/html_twig_highlight_rules.js @@ -638,12 +638,7 @@ var HTMLTwigHighlightRules = function() { 'punctuation.separator.key-value.html' ], regex: '\\b(id)\\b(\\s*)(=)', push: - [ { token: [], - regex: '(?<=\'|")', - TODO: 'FIXME: regexp doesn\'t have js equivalent', - originalRegex: '(?<=\'|")', - next: 'pop' }, - { token: 'punctuation.definition.string.begin.html', + [{ token: 'punctuation.definition.string.begin.html', regex: '"', push: [ { token: 'punctuation.definition.string.end.html', @@ -661,7 +656,8 @@ var HTMLTwigHighlightRules = function() { { include: '#embedded-code' }, { include: '#entities' }, { defaultToken: 'string.quoted.single.html' } ] }, - { defaultToken: 'meta.attribute-with-value.id.html' } ] } ], + { defaultToken: 'meta.attribute-with-value.id.html' }, + { token: '', regex: '', next: 'pop' } ] } ], '#tag-stuff': [ { include: '#tag-id-attribute' }, { include: '#tag-generic-attribute' }, diff --git a/lib/ace/mode/julia.js b/lib/ace/mode/julia.js index 7e29ae88..cb28d62c 100644 --- a/lib/ace/mode/julia.js +++ b/lib/ace/mode/julia.js @@ -55,8 +55,8 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; + this.lineCommentStart = "#"; + this.blockComment = ""; // Extra logic goes here. }).call(Mode.prototype); diff --git a/lib/ace/mode/julia_highlight_rules.js b/lib/ace/mode/julia_highlight_rules.js index 497e6d56..fabec1e3 100644 --- a/lib/ace/mode/julia_highlight_rules.js +++ b/lib/ace/mode/julia_highlight_rules.js @@ -60,32 +60,15 @@ var JuliaHighlightRules = function() { [ { token: [ 'punctuation.definition.comment.julia', 'comment.line.number-sign.julia' ], - regex: '(?