File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 140140 state . context = new Context ( state . context , "list-literal" , state . variables ) ;
141141 state . lookupVariables = false ;
142142 return null ;
143- } else if ( stream . match ( / m a p \b / ) ) {
143+ } else if ( stream . match ( / \b m a p (? = \( ) / ) ) {
144144 state . soyState . push ( "map-literal" ) ;
145145 return "keyword" ;
146- } else if ( stream . match ( / r e c o r d \b / ) ) {
146+ } else if ( stream . match ( / \b r e c o r d (? = \( ) / ) ) {
147147 state . soyState . push ( "record-literal" ) ;
148148 return "keyword" ;
149149 } else if ( stream . match ( / ( [ \w ] + ) (? = \( ) / ) ) {
454454 state . indent -= 2 * config . indentUnit ;
455455 return null ;
456456 }
457- if ( stream . match ( / \w + (? = \s + a s ) / ) ) {
457+ if ( stream . match ( / \w + (? = \s + a s \b ) / ) ) {
458458 return "variable" ;
459459 }
460460 if ( match = stream . match ( / \w + / ) ) {
461- return / ( f r o m | a s ) / . test ( match [ 0 ] ) ? "keyword" : "def" ;
461+ return / \b ( f r o m | a s ) \b / . test ( match [ 0 ] ) ? "keyword" : "def" ;
462462 }
463463 if ( match = stream . match ( / ^ [ " ' ] / ) ) {
464464 state . soyState . push ( "string" ) ;
605605 state . indent += 2 * config . indentUnit ;
606606 state . soyState . push ( "tag" ) ;
607607 return "keyword" ;
608- } else if ( ! state . context && stream . match ( / \b i m p o r t \b / ) ) {
608+ } else if ( ! state . context && stream . sol ( ) && stream . match ( / i m p o r t \b / ) ) {
609609 state . soyState . push ( "import" ) ;
610610 state . indent += 2 * config . indentUnit ;
611611 return "keyword" ;
You can’t perform that action at this time.
0 commit comments