Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
9364271e
Commit
9364271e
authored
Jan 19, 2010
by
seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes parsing of multi-line if (and other) statements
git-svn-id:
http://svn.dwoo.org/trunk@327
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
9eb8c960
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Compiler.php
lib/Dwoo/Compiler.php
+1
-0
CompilerTests.php
tests/CompilerTests.php
+11
-1
No files found.
lib/Dwoo/Compiler.php
View file @
9364271e
...
...
@@ -2493,6 +2493,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
$src
=
$substr
;
$substr
=
trim
(
$substr
);
if
(
strtolower
(
$substr
)
===
'false'
||
strtolower
(
$substr
)
===
'no'
||
strtolower
(
$substr
)
===
'off'
)
{
if
(
$this
->
debug
)
echo
'BOOLEAN(FALSE) PARSED<br />'
;
...
...
tests/CompilerTests.php
View file @
9364271e
...
...
@@ -672,7 +672,7 @@ replace="BAR"
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
'foo'
,
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
}
public
function
testStaticPropertyAccess
()
{
$tpl
=
new
Dwoo_Template_String
(
'{StaticHelper::$foo}/{StaticHelper::$foo * StaticHelper::$foo + 5}/{upper StaticHelper::$foo}/{StaticHelper::$foo++}/{StaticHelper::$foo}'
);
...
...
@@ -686,6 +686,16 @@ replace="BAR"
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
'a:b:c:d:e:f'
,
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
}
public
function
testParsingOfMultilineIf
()
{
$tpl
=
new
Dwoo_Template_String
(
'{if 0
|| $null == "aa"}
fail
{/if}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
''
,
trim
(
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
)));
}
}
function
excessArgsHelper
(
$a
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment