Lines Matching +full:detect +full:- +full:newline
44 ... 1 COLON NEWLINE INDENT PRINT a NEWLINE DEDENT b ASSIGN 3 ...
49 Upon NEWLINE token from the lexer, however, an INDENT or DEDENT token
50 may need to be sent to the parser. The NEWLINE is the trigger for
51 this class to do it's job. NEWLINE is saved and then the first token
52 of the next line is examined. If non-leading-whitespace token,
54 the column of the next non-whitespace token will dictate indent vs
60 A stack of column numbers is tracked and used to detect changes
75 this.sp=-1; // grow upwards
79 this.lastTokenAddedIndex = -1;
109 I use char position in line 0..n-1 instead.
133 // if not a NEWLINE, doesn't signal indent/dedent work; just enqueue
134 if ( t.getType()!=PythonLexer.NEWLINE ) {
135 var hiddenTokens = this.stream.getTokens(this.lastTokenAddedIndex+1,t.getTokenIndex()-1);
144 // save NEWLINE in the queue
145 var hiddenTokens = this.stream.getTokens(this.lastTokenAddedIndex+1,t.getTokenIndex()-1);
156 hiddenTokens = this.stream.getTokens(this.lastTokenAddedIndex+1,t.getTokenIndex()-1);
162 // compute cpos as the char pos of next non-WS token in line
165 cpos = -1; // pretend EOF always happens at left edge
184 for (var d=this.sp-1; d>=prevIndex; d--) {
212 this.sp--;
220 /** Return the index on stack of previous indent level == i else -1 */
222 for (var j=this.sp-1; j>=0; j--) {
232 for (var j=this.sp; j>=0; j--) {
241 ------- t1 -------
247 ------- t2 -------
252 ------- t3 -------
258 ------- t4 -------
270 ------- t5 -------