File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 256256 // Otherwise
257257 return "variable" ;
258258 }
259+ if ( match = stream . match ( / ^ \$ ( [ \w ] + ) / ) ) {
260+ state . soyState . pop ( ) ;
261+ return ref ( state . variables , match [ 1 ] , ! state . lookupVariables ) ;
262+ }
263+
259264 stream . next ( ) ;
260265 return null ;
261266
300305 } else if ( peekChar == "[" ) {
301306 state . soyState . push ( 'param-type-record' ) ;
302307 return null ;
308+ } else if ( peekChar == "(" ) {
309+ state . soyState . push ( 'param-type-template' ) ;
310+ return null ;
303311 } else if ( peekChar == "<" ) {
304312 state . soyState . push ( 'param-type-parameter' ) ;
305313 return null ;
334342 stream . next ( ) ;
335343 return null ;
336344
345+ case "param-type-template" :
346+ if ( stream . match ( / [ > ] / ) ) {
347+ state . soyState . pop ( ) ;
348+ state . soyState . push ( 'param-type' ) ;
349+ return null ;
350+ }
351+ if ( stream . match ( / ^ \w + / ) ) {
352+ state . soyState . push ( 'param-type' ) ;
353+ return "def" ;
354+ }
355+ stream . next ( ) ;
356+ return null ;
357+
337358 case "var-def" :
338359 if ( match = stream . match ( / ^ \$ ( [ \w ] + ) / ) ) {
339360 state . variables = prepend ( state . variables , match [ 1 ] ) ;
Original file line number Diff line number Diff line change 178178 '[keyword {/template}]' ,
179179 '' ) ;
180180
181+ MT ( 'param-type-template' ,
182+ '[keyword {template] [def .foo][keyword }]' ,
183+ ' [keyword {@param] [def renderer]: ([def s]:[type string])=>[type html][keyword }]' ,
184+ ' [keyword {call] [variable-2 $renderer] [keyword /}]' ,
185+ '[keyword {/template}]' ,
186+ '' ) ;
187+
181188 MT ( 'single-quote-strings' ,
182189 '[keyword {][string "foo"] [string \'bar\'][keyword }]' ,
183190 '' ) ;
You can’t perform that action at this time.
0 commit comments