1 |
- {"version":3,"file":"mode-forth-586c5a44.js","sources":["../../node_modules/ace-builds/src-noconflict/mode-forth.js"],"sourcesContent":["ace.define(\"ace/mode/forth_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/vze26m98/Forth.tmbundle/master/Syntaxes/Forth.tmLanguage (uuid: ) */\n\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar ForthHighlightRules = function () {\n this.$rules = { start: [{ include: '#forth' }],\n '#comment': [{ token: 'comment.line.double-dash.forth',\n regex: '(?:^|\\\\s)--\\\\s.*$',\n comment: 'line comments for iForth' },\n { token: 'comment.line.backslash.forth',\n regex: '(?:^|\\\\s)\\\\\\\\[\\\\s\\\\S]*$',\n comment: 'ANSI line comment' },\n { token: 'comment.line.backslash-g.forth',\n regex: '(?:^|\\\\s)\\\\\\\\[Gg] .*$',\n comment: 'gForth line comment' },\n { token: 'comment.block.forth',\n regex: '(?:^|\\\\s)\\\\(\\\\*(?=\\\\s|$)',\n push: [{ token: 'comment.block.forth',\n regex: '(?:^|\\\\s)\\\\*\\\\)(?=\\\\s|$)',\n next: 'pop' },\n { defaultToken: 'comment.block.forth' }],\n comment: 'multiline comments for iForth' },\n { token: 'comment.block.documentation.forth',\n regex: '\\\\bDOC\\\\b',\n caseInsensitive: true,\n push: [{ token: 'comment.block.documentation.forth',\n regex: '\\\\bENDDOC\\\\b',\n caseInsensitive: true,\n next: 'pop' },\n { defaultToken: 'comment.block.documentation.forth' }],\n comment: 'documentation comments for iForth' },\n { token: 'comment.line.parentheses.forth',\n regex: '(?:^|\\\\s)\\\\.?\\\\( [^)]*\\\\)',\n comment: 'ANSI line comment' }],\n '#constant': [{ token: 'constant.language.forth',\n regex: '(?:^|\\\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\\\s|$)',\n caseInsensitive: true },\n { token: 'constant.numeric.forth',\n regex: '(?:^|\\\\s)[$#%]?[-+]?[0-9]+(?:\\\\.[0-9]*e-?[0-9]+|\\\\.?[0-9a-fA-F]*)(?=\\\\s|$)' },\n { token: 'constant.character.forth',\n regex: '(?:^|\\\\s)(?:[&^]\\\\S|(?:\"|\\')\\\\S(?:\"|\\'))(?=\\\\s|$)' }],\n '#forth': [{ include: '#constant' },\n { include: '#comment' },\n { include: '#string' },\n { include: '#word' },\n { include: '#variable' },\n { include: '#storage' },\n { include: '#word-def' }],\n '#storage': [{ token: 'storage.type.forth',\n regex: '(?:^|\\\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\\\s|$)',\n caseInsensitive: true }],\n '#string': [{ token: 'string.quoted.double.forth',\n regex: '(ABORT\" |BREAK\" |\\\\.\" |C\" |0\"|S\\\\\\\\?\" )([^\"]+\")',\n caseInsensitive: true },\n { token: 'string.unquoted.forth',\n regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\\\S+(?=\\\\s|$)',\n caseInsensitive: true }],\n '#variable': [{ token: 'variable.language.forth',\n regex: '\\\\b(?:I|J)\\\\b',\n caseInsensitive: true }],\n '#word': [{ token: 'keyword.control.immediate.forth',\n regex: '(?:^|\\\\s)\\\\[(?:\\\\?DO|\\\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\\\](?=\\\\s|$)',\n caseInsensitive: true },\n { token: 'keyword.other.immediate.forth',\n regex: '(?:^|\\\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\\'S|])(?=\\\\s|$)',\n caseInsensitive: true },\n { token: 'keyword.control.compile-only.forth',\n 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|$)',\n caseInsensitive: true },\n { token: 'keyword.other.compile-only.forth',\n regex: '(?:^|\\\\s)(?:\\\\?DUP-0=-IF|\\\\?DUP-IF|\\\\)|\\\\[|\\\\[\\'\\\\]|\\\\[CHAR\\\\]|\\\\[COMPILE\\\\]|\\\\[IS\\\\]|\\\\[TO\\\\]|<COMPILATION|<INTERPRETATION|ASSERT\\\\(|ASSERT0\\\\(|ASSERT1\\\\(|ASSERT2\\\\(|ASSERT3\\\\(|COMPILATION>|DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\\\s|$)',\n caseInsensitive: true },\n { token: 'keyword.other.non-immediate.forth',\n regex: '(?:^|\\\\s)(?:\\'|<IS>|<TO>|CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\\\s|$)',\n caseInsensitive: true },\n { token: 'keyword.other.warning.forth',\n regex: '(?:^|\\\\s)(?:~~|BREAK:|BREAK\"|DBG)(?=\\\\s|$)',\n caseInsensitive: true }],\n '#word-def': [{ token: ['keyword.other.compile-only.forth',\n 'keyword.other.compile-only.forth',\n 'meta.block.forth',\n 'entity.name.function.forth'],\n regex: '(:NONAME)|(^:|\\\\s:)(\\\\s)(\\\\S+)(?=\\\\s|$)',\n caseInsensitive: true,\n push: [{ token: 'keyword.other.compile-only.forth',\n regex: ';(?:CODE)?',\n caseInsensitive: true,\n next: 'pop' },\n { include: '#constant' },\n { include: '#comment' },\n { include: '#string' },\n { include: '#word' },\n { include: '#variable' },\n { include: '#storage' },\n { defaultToken: 'meta.block.forth' }] }] };\n this.normalizeRules();\n};\nForthHighlightRules.metaData = { fileTypes: ['frt', 'fs', 'ldr', 'fth', '4th'],\n foldingStartMarker: '/\\\\*\\\\*|\\\\{\\\\s*$',\n foldingStopMarker: '\\\\*\\\\*/|^\\\\s*\\\\}',\n keyEquivalent: '^~F',\n name: 'Forth',\n scopeName: 'source.forth' };\noop.inherits(ForthHighlightRules, TextHighlightRules);\nexports.ForthHighlightRules = ForthHighlightRules;\n\n});\n\nace.define(\"ace/mode/folding/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/range\",\"ace/mode/folding/fold_mode\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Range = require(\"../../range\").Range;\nvar BaseFoldMode = require(\"./fold_mode\").FoldMode;\nvar FoldMode = exports.FoldMode = function (commentRegex) {\n if (commentRegex) {\n this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.start));\n this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.end));\n }\n};\noop.inherits(FoldMode, BaseFoldMode);\n(function () {\n this.foldingStartMarker = /([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/;\n this.foldingStopMarker = /^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/;\n this.singleLineBlockCommentRe = /^\\s*(\\/\\*).*\\*\\/\\s*$/;\n this.tripleStarBlockCommentRe = /^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/;\n this.startRegionRe = /^\\s*(\\/\\*|\\/\\/)#?region\\b/;\n this._getFoldWidgetBase = this.getFoldWidget;\n this.getFoldWidget = function (session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.singleLineBlockCommentRe.test(line)) {\n if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))\n return \"\";\n }\n var fw = this._getFoldWidgetBase(session, foldStyle, row);\n if (!fw && this.startRegionRe.test(line))\n return \"start\"; // lineCommentRegionStart\n return fw;\n };\n this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {\n var line = session.getLine(row);\n if (this.startRegionRe.test(line))\n return this.getCommentRegionBlock(session, line, row);\n var match = line.match(this.foldingStartMarker);\n if (match) {\n var i = match.index;\n if (match[1])\n return this.openingBracketBlock(session, match[1], row, i);\n var range = session.getCommentFoldRange(row, i + match[0].length, 1);\n if (range && !range.isMultiLine()) {\n if (forceMultiline) {\n range = this.getSectionRange(session, row);\n }\n else if (foldStyle != \"all\")\n range = null;\n }\n return range;\n }\n if (foldStyle === \"markbegin\")\n return;\n var match = line.match(this.foldingStopMarker);\n if (match) {\n var i = match.index + match[0].length;\n if (match[1])\n return this.closingBracketBlock(session, match[1], row, i);\n return session.getCommentFoldRange(row, i, -1);\n }\n };\n this.getSectionRange = function (session, row) {\n var line = session.getLine(row);\n var startIndent = line.search(/\\S/);\n var startRow = row;\n var startColumn = line.length;\n row = row + 1;\n var endRow = row;\n var maxRow = session.getLength();\n while (++row < maxRow) {\n line = session.getLine(row);\n var indent = line.search(/\\S/);\n if (indent === -1)\n continue;\n if (startIndent > indent)\n break;\n var subRange = this.getFoldWidgetRange(session, \"all\", row);\n if (subRange) {\n if (subRange.start.row <= startRow) {\n break;\n }\n else if (subRange.isMultiLine()) {\n row = subRange.end.row;\n }\n else if (startIndent == indent) {\n break;\n }\n }\n endRow = row;\n }\n return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);\n };\n this.getCommentRegionBlock = function (session, line, row) {\n var startColumn = line.search(/\\s*$/);\n var maxRow = session.getLength();\n var startRow = row;\n var re = /^\\s*(?:\\/\\*|\\/\\/|
|