@@ -38,22 +38,23 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
3838var MAX_LINE_LENGTH = 5000 ;
3939
4040/**
41- * @class BackgroundTokenizer
41+ *
4242 *
4343 * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use.
4444 *
4545 * If a certain row is changed, everything below that row is re-tokenized.
4646 *
47+ * @class BackgroundTokenizer
4748 **/
4849
4950/**
50- * new BackgroundTokenizer(tokenizer, editor)
51+ * Creates a new ` BackgroundTokenizer` object.
5152 * @param {Tokenizer } tokenizer The tokenizer to use
5253 * @param {Editor } editor The editor to associate with
5354 *
54- * Creates a new `BackgroundTokenizer` object.
55- *
56- *
55+ *
56+ *
57+ * @constructor
5758 **/
5859
5960var BackgroundTokenizer = function ( tokenizer , editor ) {
@@ -100,10 +101,10 @@ var BackgroundTokenizer = function(tokenizer, editor) {
100101 oop . implement ( this , EventEmitter ) ;
101102
102103 /**
103- * @param {Tokenizer } tokenizer The new tokenizer to use
104- *
105104 * Sets a new tokenizer for this object.
106105 *
106+ * @param {Tokenizer } tokenizer The new tokenizer to use
107+ *
107108 **/
108109 this . setTokenizer = function ( tokenizer ) {
109110 this . tokenizer = tokenizer ;
@@ -114,10 +115,8 @@ var BackgroundTokenizer = function(tokenizer, editor) {
114115 } ;
115116
116117 /**
117- * @param {Document } doc The new document to associate with
118- *
119118 * Sets a new document to associate with this object.
120- *
119+ * @param { Document } doc The new document to associate with
121120 **/
122121 this . setDocument = function ( doc ) {
123122 this . doc = doc ;
@@ -128,18 +127,17 @@ var BackgroundTokenizer = function(tokenizer, editor) {
128127 } ;
129128
130129 /**
130+ * Fires whenever the background tokeniziers between a range of rows are going to be updated.
131+ *
131132 * @event update
132133 * @param {Object } e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated.
133134 *
134- * Fires whenever the background tokeniziers between a range of rows are going to be updated.
135- *
136135 **/
137136 /**
137+ * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated.
138138 * @param {Number } firstRow The starting row region
139139 * @param {Number } lastRow The final row region
140140 *
141- * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated.
142- *
143141 **/
144142 this . fireUpdateEvent = function ( firstRow , lastRow ) {
145143 var data = {
@@ -150,10 +148,10 @@ var BackgroundTokenizer = function(tokenizer, editor) {
150148 } ;
151149
152150 /**
153- * @param {Number } startRow The row to start at
154- *
155151 * Starts tokenizing at the row indicated.
156152 *
153+ * @param {Number } startRow The row to start at
154+ *
157155 **/
158156 this . start = function ( startRow ) {
159157 this . currentLine = Math . min ( startRow || 0 , this . currentLine , this . doc . getLength ( ) ) ;
@@ -202,19 +200,21 @@ var BackgroundTokenizer = function(tokenizer, editor) {
202200 } ;
203201
204202 /**
203+ * Gives list of tokens of the row. (tokens are cached)
204+ *
205205 * @param {Number } row The row to get tokens at
206206 *
207- * Gives list of tokens of the row. (tokens are cached)
207+ *
208208 *
209209 **/
210210 this . getTokens = function ( row ) {
211211 return this . lines [ row ] || this . $tokenizeRow ( row ) ;
212212 } ;
213213
214214 /**
215- * @param {Number } row The row to get state at
216- *
217215 * [Returns the state of tokenization at the end of a row.]{: #BackgroundTokenizer.getState}
216+ *
217+ * @param {Number } row The row to get state at
218218 **/
219219 this . getState = function ( row ) {
220220 if ( this . currentLine == row )
0 commit comments