allow setting MaxTokenCount in tokenizer
This commit is contained in:
parent
214c3a9b5d
commit
2c9dbced9b
1 changed files with 4 additions and 2 deletions
|
|
@ -34,8 +34,6 @@ define(function(require, exports, module) {
|
||||||
// tokenizing lines longer than this makes editor very slow
|
// tokenizing lines longer than this makes editor very slow
|
||||||
var MAX_TOKEN_COUNT = 1000;
|
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).
|
* 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
|
* @class Tokenizer
|
||||||
**/
|
**/
|
||||||
|
|
@ -128,6 +126,10 @@ var Tokenizer = function(rules) {
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
this.$setMaxTokenCount = function(m) {
|
||||||
|
MAX_TOKEN_COUNT = m | 0;
|
||||||
|
};
|
||||||
|
|
||||||
this.$applyToken = function(str) {
|
this.$applyToken = function(str) {
|
||||||
var values = this.splitRegex.exec(str).slice(1);
|
var values = this.splitRegex.exec(str).slice(1);
|
||||||
var types = this.token.apply(this, values);
|
var types = this.token.apply(this, values);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue