Documentation

Markers

Table of Contents

src/Compiler.php 7
src/Context.php 2
src/Encoder.php 1
src/Exporter.php 3
src/Expression.php 3
src/Flags.php 15
src/LightnCandy.php 6
src/loader.php 1
src/Parser.php 31
src/Partial.php 3
src/Runtime.php 7
src/SafeString.php 1
src/Token.php 3
src/Validator.php 23

Compiler.php

Type Line Description
10 github.com/zordius/lightncandy
51 Handle dynamic partials
54 Do PHP code generation.
102 Return generated PHP code string.
274 change base when trace to parent
291 To support recursive context lookup, instance properties + methods and lambdas
292 the only way is using slower rendering time variable resolver.

Context.php

Type Line Description
10 github.com/zordius/lightncandy
208 Regist helper names only

Encoder.php

Type Line Description
10 github.com/zordius/lightncandy

Exporter.php

Type Line Description
10 github.com/zordius/lightncandy
277 replace the constants
280 compress space

Expression.php

Type Line Description
10 github.com/zordius/lightncandy
97 trace to parent
104 handle @root, @index, @key, @last, etc

Flags.php

Type Line Description
10 github.com/zordius/lightncandy
27 Compile time error handling flags
31 JavaScript compatibility
36 Handlebars.js compatibility
53 PHP behavior flags
62 Mustache compatibility
69 Template rendering time debug flags
72 alias flags
73 FLAG_ECHO + FLAG_STANDALONEPHP
74 FLAG_JSTRUE + FLAG_JSOBJECT + FLAG_JSLENGTH
75 FLAG_PROPERTY + FLAG_METHOD
76 FLAG_ERROR_SKIPPARTIAL + FLAG_MUSTACHELOOKUP + FLAG_MUSTACHELAMBDA + FLAG_NOHBHELPERS + FLAG_MUSTACHESECTION + FLAG_RUNTIMEPARTIAL + FLAG_JSTRUE + FLAG_JSOBJECT
77 FLAG_THIS + FLAG_PARENT + FLAG_HBESCAPE + FLAG_ADVARNAME + FLAG_SPACECTL + FLAG_NAMEDARG + FLAG_SPVARS + FLAG_SLASH + FLAG_ELSE + FLAG_RAWBLOCK
78 FLAG_JS + FLAG_HANDLEBARS
79 FLAG_HANDLEBARSJS + FLAG_INSTANCE + FLAG_RUNTIMEPARTIAL + FLAG_MUSTACHELOOKUP

LightnCandy.php

Type Line Description
10 github.com/zordius/lightncandy
49 return false when fatal error
54 Or, return full PHP render codes as string
80 return false when fatal error
129 format.
166 text/plain,' . urlencode($php));

loader.php

Type Line Description
10 github.com/zordius/lightncandy

Parser.php

Type Line Description
10 github.com/zordius/lightncandy
27 Compile time error handling flags
113 handle number
118 handle double quoted string
123 handle single quoted string
128 handle boolean, null and undefined
136 handle ..
141 Trace to parent for ../ N times
142 ', function () use (&$levels) {
147 remove ./ in path
148 ', '', $v, -1, $scoped);
340 handle (...)
347 handle |...|
360 handle foo=(...)
369 foo] Rule 1: no starting [ or [ not start from head
371 [bar Rule 2: no ending ] or ] not in the end
373 ]bar. Rule 3: middle ] not before .
375 .foo[ Rule 4: middle [ not after .
381 Scan for invalid charactors which not be protected by [ ]
382 now make ( and ) pass, later fix
414 begin with '(' without ending ')'
419 begin with '"' without ending '"'
424 begin with \' without ending '
429 '="' exists without ending '"'
434 '[' exists without ending ']'
439 =\' exists without ending '
444 continue to next match when =( exists without ending )
472 Parse arguments and deal with "..." or [...] or (...) or \'...\' or |...|
492 continue from previous match when expect something
498 end an argument when end with expected charactor
533 continue to next match when 'as' without ending '|'

Partial.php

Type Line Description
9 github.com/zordius/lightncandy
134 Check for recursive partial
203 callbacks inside partial should be aware of $sp

Runtime.php

Type Line Description
10 github.com/zordius/lightncandy
63 Build array of reference for call_user_func_array
286 Use full namespace classname for more specific code export/match in Exporter.php replaceSafeString.
309 Use full namespace classname for more specific code export/match in Exporter.php replaceSafeString.
370 #var, detect input type is object or not
379 Detect input type is object or not when never done once
631 $invert the logic

SafeString.php

Type Line Description
10 github.com/zordius/lightncandy

Token.php

Type Line Description
10 github.com/zordius/lightncandy
27 RegExps
30 Positions of matched token

Validator.php

Type Line Description
10 github.com/zordius/lightncandy
40 Skip a token when it is slash escaped
160 {{ }}} or {{{ }} are invalid
165 {{{# }}} or {{{! }}} or {{{/ }}} or {{{^ }}} are invalid.
209 no break
486 if we didn't match our $pop, we didn't actually do a level, so only subtract a level here
505 we need to repeat a level due to else chains: {{else if}}
510 no break
555 skip parse when inside raw block
562 Handle raw block
630 Handle spacing (standalone tags, partial indent)
897 left line change detection
900 right line change detection
903 setup ahead flag
906 reset partial indent
908 same tags in the same line , not standalone
915 not standalone because other things in the same line ahead
919 not standalone because other things in the same line behind
924 both side cr
925 first line without left
926 final line
928 handle partial
940 Handle space control.

Search results