mode-vbscript.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. ace.define("ace/mode/vbscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var VBScriptHighlightRules = function() {
  6. var keywordMapper = this.createKeywordMapper({
  7. "keyword.control.asp": "If|Then|Else|ElseIf|End|While|Wend|For|To|Each|Case|Select|Return"
  8. + "|Continue|Do|Until|Loop|Next|With|Exit|Function|Property|Type|Enum|Sub|IIf|Class",
  9. "storage.type.asp": "Dim|Call|Const|Redim|Set|Let|Get|New|Randomize|Option|Explicit|Preserve|Erase|Execute|ExecuteGlobal",
  10. "storage.modifier.asp": "Private|Public|Default",
  11. "keyword.operator.asp": "Mod|And|Not|Or|Xor|As|Eqv|Imp|Is",
  12. "constant.language.asp": "Empty|False|Nothing|Null|True",
  13. "variable.language.vb.asp": "Me",
  14. "support.class.vb.asp": "RegExp",
  15. "support.class.asp": "Application|ObjectContext|Request|Response|Server|Session",
  16. "support.class.collection.asp": "Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables",
  17. "support.constant.asp": "TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute"
  18. + "|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout",
  19. "support.function.asp": "Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog"
  20. + "|BinaryWrite|Clear|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex",
  21. "support.function.event.asp": "Application_OnEnd|Application_OnStart"
  22. + "|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart",
  23. "support.function.vb.asp": "Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng"
  24. + "|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial"
  25. + "|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency"
  26. + "|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex"
  27. + "|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric"
  28. + "|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim"
  29. + "|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace"
  30. + "|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion"
  31. + "|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse"
  32. + "|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year"
  33. + "|AscB|AscW|ChrB|ChrW|InStrB|LeftB|LenB|MidB|RightB|Abs|GetUILanguage",
  34. "support.type.vb.asp": "vbTrue|vbFalse|vbCr|vbCrLf|vbFormFeed|vbLf|vbNewLine|vbNullChar|vbNullString"
  35. + "|vbTab|vbVerticalTab|vbBinaryCompare|vbTextCompare|vbSunday|vbMonday|vbTuesday|vbWednesday"
  36. + "|vbThursday|vbFriday|vbSaturday|vbUseSystemDayOfWeek|vbFirstJan1|vbFirstFourDays|vbFirstFullWeek"
  37. + "|vbGeneralDate|vbLongDate|vbShortDate|vbLongTime|vbShortTime|vbObjectError|vbEmpty|vbNull|vbInteger"
  38. + "|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant"
  39. + "|vbDataObject|vbDecimal|vbByte|vbArray|vbOKOnly|vbOKCancel|vbAbortRetryIgnore|vbYesNoCancel|vbYesNo"
  40. + "|vbRetryCancel|vbCritical|vbQuestion|vbExclamation|vbInformation|vbDefaultButton1|vbDefaultButton2"
  41. + "|vbDefaultButton3|vbDefaultButton4|vbApplicationModal|vbSystemModal|vbOK|vbCancel|vbAbort|vbRetry|vbIgnore|vbYes|vbNo"
  42. + "|vbUseDefault"
  43. }, "identifier", true);
  44. this.$rules = {
  45. "start": [
  46. {
  47. token: [
  48. "meta.ending-space"
  49. ],
  50. regex: "$"
  51. },
  52. {
  53. token: [null],
  54. regex: "^(?=\\t)",
  55. next: "state_3"
  56. },
  57. {
  58. token: [null],
  59. regex: "^(?= )",
  60. next: "state_4"
  61. },
  62. {
  63. token: [
  64. "text",
  65. "storage.type.function.asp",
  66. "text",
  67. "entity.name.function.asp",
  68. "text",
  69. "punctuation.definition.parameters.asp",
  70. "variable.parameter.function.asp",
  71. "punctuation.definition.parameters.asp"
  72. ],
  73. regex: "^(\\s*)(Function|Sub)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))"
  74. },
  75. {
  76. token: "punctuation.definition.comment.asp",
  77. regex: "'|REM(?=\\s|$)",
  78. next: "comment",
  79. caseInsensitive: true
  80. },
  81. {
  82. token: "storage.type.asp",
  83. regex: "On\\s+Error\\s+(?:Resume\\s+Next|GoTo)\\b",
  84. caseInsensitive: true
  85. },
  86. {
  87. token: "punctuation.definition.string.begin.asp",
  88. regex: '"',
  89. next: "string"
  90. },
  91. {
  92. token: [
  93. "punctuation.definition.variable.asp"
  94. ],
  95. regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"
  96. },
  97. {
  98. token: "constant.numeric.asp",
  99. regex: "-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b"
  100. },
  101. {
  102. regex: "\\w+",
  103. token: keywordMapper
  104. },
  105. {
  106. token: ["entity.name.function.asp"],
  107. regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))"
  108. },
  109. {
  110. token: ["keyword.operator.asp"],
  111. regex: "\\-|\\+|\\*|\\/|\\>|\\<|\\=|\\&|\\\\|\\^"
  112. }
  113. ],
  114. "state_3": [
  115. {
  116. token: [
  117. "meta.odd-tab.tabs",
  118. "meta.even-tab.tabs"
  119. ],
  120. regex: "(\\t)(\\t)?"
  121. },
  122. {
  123. token: "meta.leading-space",
  124. regex: "(?=[^\\t])",
  125. next: "start"
  126. },
  127. {
  128. token: "meta.leading-space",
  129. regex: ".",
  130. next: "state_3"
  131. }
  132. ],
  133. "state_4": [
  134. {
  135. token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"],
  136. regex: "( )( )?"
  137. },
  138. {
  139. token: "meta.leading-space",
  140. regex: "(?=[^ ])",
  141. next: "start"
  142. },
  143. {
  144. defaultToken: "meta.leading-space"
  145. }
  146. ],
  147. "comment": [
  148. {
  149. token: "comment.line.apostrophe.asp",
  150. regex: "$",
  151. next: "start"
  152. },
  153. {
  154. defaultToken: "comment.line.apostrophe.asp"
  155. }
  156. ],
  157. "string": [
  158. {
  159. token: "constant.character.escape.apostrophe.asp",
  160. regex: '""'
  161. },
  162. {
  163. token: "string.quoted.double.asp",
  164. regex: '"',
  165. next: "start"
  166. },
  167. {
  168. defaultToken: "string.quoted.double.asp"
  169. }
  170. ]
  171. };
  172. };
  173. oop.inherits(VBScriptHighlightRules, TextHighlightRules);
  174. exports.VBScriptHighlightRules = VBScriptHighlightRules;
  175. });
  176. ace.define("ace/mode/folding/vbscript",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) {
  177. "use strict";
  178. var oop = require("../../lib/oop");
  179. var BaseFoldMode = require("./fold_mode").FoldMode;
  180. var Range = require("../../range").Range;
  181. var TokenIterator = require("../../token_iterator").TokenIterator;
  182. var FoldMode = exports.FoldMode = function() {};
  183. oop.inherits(FoldMode, BaseFoldMode);
  184. (function() {
  185. this.indentKeywords = {
  186. "class": 1,
  187. "function": 1,
  188. "sub": 1,
  189. "if": 1,
  190. "select": 1,
  191. "do": 1,
  192. "for": 1,
  193. "while": 1,
  194. "with": 1,
  195. "property": 1,
  196. "else": 1,
  197. "elseif": 1,
  198. "end": -1,
  199. "loop": -1,
  200. "next": -1,
  201. "wend": -1
  202. };
  203. this.foldingStartMarker = /(?:\s|^)(class|function|sub|if|select|do|for|while|with|property|else|elseif)\b/i;
  204. this.foldingStopMarker = /\b(end|loop|next|wend)\b/i;
  205. this.getFoldWidgetRange = function (session, foldStyle, row) {
  206. var line = session.getLine(row);
  207. var isStart = this.foldingStartMarker.test(line);
  208. var isEnd = this.foldingStopMarker.test(line);
  209. if (isStart || isEnd) {
  210. var match = (isEnd) ? this.foldingStopMarker.exec(line) : this.foldingStartMarker.exec(line);
  211. var keyword = match && match[1].toLowerCase();
  212. if (keyword) {
  213. var type = session.getTokenAt(row, match.index + 2).type;
  214. if (type === "keyword.control.asp" || type === "storage.type.function.asp")
  215. return this.vbsBlock(session, row, match.index + 2);
  216. }
  217. }
  218. };
  219. this.getFoldWidget = function(session, foldStyle, row) {
  220. var line = session.getLine(row);
  221. var isStart = this.foldingStartMarker.test(line);
  222. var isEnd = this.foldingStopMarker.test(line);
  223. if (isStart && !isEnd) {
  224. var match = this.foldingStartMarker.exec(line);
  225. var keyword = match && match[1].toLowerCase();
  226. if (keyword) {
  227. var type = session.getTokenAt(row, match.index + 2).type;
  228. if (type == "keyword.control.asp" || type == "storage.type.function.asp") {
  229. if (keyword == "if" && !/then\s*('|$)/i.test(line))
  230. return "";
  231. return "start";
  232. }
  233. }
  234. }
  235. return "";
  236. };
  237. this.vbsBlock = function(session, row, column, tokenRange) {
  238. var stream = new TokenIterator(session, row, column);
  239. var endOpenings = {
  240. "class": 1,
  241. "function": 1,
  242. "sub": 1,
  243. "if": 1,
  244. "select": 1,
  245. "with": 1,
  246. "property": 1,
  247. "else": 1,
  248. "elseif": 1
  249. };
  250. var token = stream.getCurrentToken();
  251. if (!token || (token.type != "keyword.control.asp" && token.type != "storage.type.function.asp"))
  252. return;
  253. var startTokenValue = token.value.toLowerCase();
  254. var val = token.value.toLowerCase();
  255. var stack = [val];
  256. var dir = this.indentKeywords[val];
  257. if (!dir)
  258. return;
  259. var firstRange = stream.getCurrentTokenRange();
  260. switch (val) {
  261. case "property":
  262. case "sub":
  263. case "function":
  264. case "if":
  265. case "select":
  266. case "do":
  267. case "for":
  268. case "class":
  269. case "while":
  270. case "with":
  271. var line = session.getLine(row);
  272. var singleLineCondition = /^\s*If\s+.*\s+Then(?!')\s+(?!')\S/i.test(line);
  273. if (singleLineCondition)
  274. return;
  275. var checkToken = new RegExp("(?:^|\\s)" + val, "i");
  276. var endTest = /^\s*End\s(If|Sub|Select|Function|Class|With|Property)\s*/i.test(line);
  277. if (!checkToken.test(line) && !endTest) {
  278. return;
  279. }
  280. if (endTest) {
  281. var tokenRange = stream.getCurrentTokenRange();
  282. stream.step = stream.stepBackward;
  283. stream.step();
  284. stream.step();
  285. token = stream.getCurrentToken();
  286. if (token) {
  287. val = token.value.toLowerCase();
  288. if (val == "end") {
  289. firstRange = stream.getCurrentTokenRange();
  290. firstRange = new Range(firstRange.start.row, firstRange.start.column, tokenRange.start.row, tokenRange.end.column);
  291. }
  292. }
  293. dir = -1;
  294. }
  295. break;
  296. case "end":
  297. var tokenPos = stream.getCurrentTokenPosition();
  298. firstRange = stream.getCurrentTokenRange();
  299. stream.step = stream.stepForward;
  300. stream.step();
  301. stream.step();
  302. token = stream.getCurrentToken();
  303. if (token) {
  304. val = token.value.toLowerCase();
  305. if (val in endOpenings) {
  306. startTokenValue = val;
  307. var nextTokenPos = stream.getCurrentTokenPosition();
  308. var endColumn = nextTokenPos.column + val.length;
  309. firstRange = new Range(tokenPos.row, tokenPos.column, nextTokenPos.row, endColumn);
  310. }
  311. }
  312. stream.step = stream.stepBackward;
  313. stream.step();
  314. stream.step();
  315. break;
  316. }
  317. var startColumn = dir === -1 ? session.getLine(row - 1).length : session.getLine(row).length;
  318. var startRow = row;
  319. var ranges = [];
  320. ranges.push(firstRange);
  321. stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
  322. while(token = stream.step()) {
  323. var outputRange = null;
  324. var ignore = false;
  325. if (token.type != "keyword.control.asp" && token.type != "storage.type.function.asp")
  326. continue;
  327. val = token.value.toLowerCase();
  328. var level = dir * this.indentKeywords[val];
  329. switch (val) {
  330. case "property":
  331. case "sub":
  332. case "function":
  333. case "if":
  334. case "select":
  335. case "do":
  336. case "for":
  337. case "class":
  338. case "while":
  339. case "with":
  340. var line = session.getLine(stream.getCurrentTokenRow());
  341. var singleLineCondition = /^\s*If\s+.*\s+Then(?!')\s+(?!')\S/i.test(line);
  342. if (singleLineCondition) {
  343. level = 0;
  344. ignore = true;
  345. }
  346. var checkToken = new RegExp("^\\s* end\\s+" + val, "i");
  347. if (checkToken.test(line)) {
  348. level = 0;
  349. ignore = true;
  350. }
  351. break;
  352. case "elseif":
  353. case "else":
  354. level = 0;
  355. if (startTokenValue != "elseif") {
  356. ignore = true;
  357. }
  358. break;
  359. }
  360. if (level > 0) {
  361. stack.unshift(val);
  362. } else if (level <= 0 && ignore === false) {
  363. stack.shift();
  364. if (!stack.length) {
  365. switch (val) {
  366. case "end":
  367. var tokenPos = stream.getCurrentTokenPosition();
  368. outputRange = stream.getCurrentTokenRange();
  369. stream.step();
  370. stream.step();
  371. token = stream.getCurrentToken();
  372. if (token) {
  373. val = token.value.toLowerCase();
  374. if (val in endOpenings) {
  375. if ((startTokenValue == "else" || startTokenValue == "elseif")) {
  376. if (val !== "if") {
  377. ranges.shift();
  378. }
  379. } else {
  380. if (val != startTokenValue)
  381. ranges.shift();
  382. }
  383. var nextTokenPos = stream.getCurrentTokenPosition();
  384. var endColumn = nextTokenPos.column + val.length;
  385. outputRange = new Range(tokenPos.row, tokenPos.column, nextTokenPos.row, endColumn);
  386. } else {
  387. ranges.shift();
  388. }
  389. } else {
  390. ranges.shift();
  391. }
  392. stream.step = stream.stepBackward;
  393. stream.step();
  394. stream.step();
  395. token = stream.getCurrentToken();
  396. val = token.value.toLowerCase();
  397. break;
  398. case "select":
  399. case "sub":
  400. case "if":
  401. case "function":
  402. case "class":
  403. case "with":
  404. case "property":
  405. if (val != startTokenValue)
  406. ranges.shift();
  407. break;
  408. case "do":
  409. if (startTokenValue != "loop")
  410. ranges.shift();
  411. break;
  412. case "loop":
  413. if (startTokenValue != "do")
  414. ranges.shift();
  415. break;
  416. case "for":
  417. if (startTokenValue != "next")
  418. ranges.shift();
  419. break;
  420. case "next":
  421. if (startTokenValue != "for")
  422. ranges.shift();
  423. break;
  424. case "while":
  425. if (startTokenValue != "wend")
  426. ranges.shift();
  427. break;
  428. case "wend":
  429. if (startTokenValue != "while")
  430. ranges.shift();
  431. break;
  432. }
  433. break;
  434. }
  435. if (level === 0){
  436. stack.unshift(val);
  437. }
  438. }
  439. }
  440. if (!token)
  441. return null;
  442. if (tokenRange) {
  443. if (!outputRange) {
  444. ranges.push(stream.getCurrentTokenRange());
  445. } else {
  446. ranges.push(outputRange);
  447. }
  448. return ranges;
  449. }
  450. var row = stream.getCurrentTokenRow();
  451. if (dir === -1) {
  452. var endColumn = session.getLine(row).length;
  453. return new Range(row, endColumn, startRow - 1, startColumn);
  454. } else
  455. return new Range(startRow, startColumn, row - 1, session.getLine(row - 1).length);
  456. };
  457. }).call(FoldMode.prototype);
  458. });
  459. ace.define("ace/mode/vbscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vbscript_highlight_rules","ace/mode/folding/vbscript","ace/range"], function(require, exports, module) {
  460. "use strict";
  461. var oop = require("../lib/oop");
  462. var TextMode = require("./text").Mode;
  463. var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules;
  464. var FoldMode = require("./folding/vbscript").FoldMode;
  465. var Range = require("../range").Range;
  466. var Mode = function() {
  467. this.HighlightRules = VBScriptHighlightRules;
  468. this.foldingRules = new FoldMode();
  469. this.$behaviour = this.$defaultBehaviour;
  470. this.indentKeywords = this.foldingRules.indentKeywords;
  471. };
  472. oop.inherits(Mode, TextMode);
  473. (function() {
  474. this.lineCommentStart = ["'", "REM"];
  475. var outdentKeywords = [
  476. "else",
  477. "elseif",
  478. "end",
  479. "loop",
  480. "next",
  481. "wend"
  482. ];
  483. function getNetIndentLevel(tokens, line, indentKeywords) {
  484. var level = 0;
  485. for (var i = 0; i < tokens.length; i++) {
  486. var token = tokens[i];
  487. if (token.type == "keyword.control.asp" || token.type == "storage.type.function.asp") {
  488. var val = token.value.toLowerCase();
  489. if (val in indentKeywords) {
  490. switch (val) {
  491. case "property":
  492. case "sub":
  493. case "function":
  494. case "select":
  495. case "do":
  496. case "for":
  497. case "class":
  498. case "while":
  499. case "with":
  500. case "if":
  501. var checkToken = new RegExp("^\\s* end\\s+" + val, "i");
  502. var singleLineCondition = /^\s*If\s+.*\s+Then(?!')\s+(?!')\S/i.test(line);
  503. if (!singleLineCondition && !checkToken.test(line))
  504. level += indentKeywords[val];
  505. break;
  506. default:
  507. level += indentKeywords[val];
  508. break;
  509. }
  510. }
  511. }
  512. }
  513. if (level < 0) {
  514. return -1;
  515. } else if (level > 0) {
  516. return 1;
  517. } else {
  518. return 0;
  519. }
  520. }
  521. this.getNextLineIndent = function(state, line, tab) {
  522. var indent = this.$getIndent(line);
  523. var level = 0;
  524. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  525. var tokens = tokenizedLine.tokens;
  526. if (state == "start") {
  527. level = getNetIndentLevel(tokens, line, this.indentKeywords);
  528. }
  529. if (level > 0) {
  530. return indent + tab;
  531. } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
  532. if (!this.checkOutdent(state, line, "\n")) {
  533. return indent.substr(0, indent.length - tab.length);
  534. }
  535. }
  536. return indent;
  537. };
  538. this.checkOutdent = function(state, line, input) {
  539. if (input != "\n" && input != "\r" && input != "\r\n")
  540. return false;
  541. var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
  542. if (!tokens || !tokens.length)
  543. return false;
  544. var val = tokens[0].value.toLowerCase();
  545. return ((tokens[0].type == "keyword.control.asp" || tokens[0].type == "storage.type.function.asp") && outdentKeywords.indexOf(val) != -1);
  546. };
  547. this.getMatching = function(session, row, column, tokenRange) {
  548. if (row == undefined) {
  549. var pos = session.selection.lead;
  550. column = pos.column;
  551. row = pos.row;
  552. }
  553. if (tokenRange == undefined)
  554. tokenRange = true;
  555. var startToken = session.getTokenAt(row, column);
  556. if (startToken) {
  557. var val = startToken.value.toLowerCase();
  558. if (val in this.indentKeywords)
  559. return this.foldingRules.vbsBlock(session, row, column, tokenRange);
  560. }
  561. };
  562. this.autoOutdent = function(state, session, row) {
  563. var line = session.getLine(row);
  564. var column = line.match(/^\s*/)[0].length;
  565. if (!column || !row) return;
  566. var startRange = this.getMatching(session, row, column + 1, false);
  567. if (!startRange || startRange.start.row == row)
  568. return;
  569. var indent = this.$getIndent(session.getLine(startRange.start.row));
  570. if (indent.length != column) {
  571. session.replace(new Range(row, 0, row, column), indent);
  572. session.outdentRows(new Range(row + 1, 0, row + 1, 0));
  573. }
  574. };
  575. this.$id = "ace/mode/vbscript";
  576. }).call(Mode.prototype);
  577. exports.Mode = Mode;
  578. }); (function() {
  579. ace.require(["ace/mode/vbscript"], function(m) {
  580. if (typeof module == "object" && typeof exports == "object" && module) {
  581. module.exports = m;
  582. }
  583. });
  584. })();