From 2c9dbced9be086e2b6e0dbc17927938bcab7c46f Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 20:38:53 +0400 Subject: [PATCH] allow setting MaxTokenCount in tokenizer --- lib/ace/tokenizer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index b4ef627b..6d63b075 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -34,8 +34,6 @@ define(function(require, exports, module) { // tokenizing lines longer than this makes editor very slow var MAX_TOKEN_COUNT = 1000; /** - * - * * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). * @class Tokenizer **/ @@ -128,6 +126,10 @@ var Tokenizer = function(rules) { }; (function() { + this.$setMaxTokenCount = function(m) { + MAX_TOKEN_COUNT = m | 0; + }; + this.$applyToken = function(str) { var values = this.splitRegex.exec(str).slice(1); var types = this.token.apply(this, values);