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
8eb1d240
Commit
8eb1d240
authored
Feb 19, 2010
by
seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a parsing bug with method calls used as arguments with a comma following.
git-svn-id:
http://svn.dwoo.org/trunk@339
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
a91a53f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
CHANGELOG
CHANGELOG
+2
-0
Compiler.php
lib/Dwoo/Compiler.php
+1
-1
CompilerTests.php
tests/CompilerTests.php
+7
-0
No files found.
CHANGELOG
View file @
8eb1d240
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
* Fixed parsing of quoted keywords in if statements, like '
not
' was
* Fixed parsing of quoted keywords in if statements, like '
not
' was
parsed as ! because using {if not $foo} is valid, but it was impossible
parsed as ! because using {if not $foo} is valid, but it was impossible
to use them even as string.
to use them even as string.
* Fixed parsing bug with method calls used as arguments with a comma
following.
[2010-02-07] 1.1.1
[2010-02-07] 1.1.1
+ Added {optional} plugin that just prints an optional var without any
+ Added {optional} plugin that just prints an optional var without any
...
...
lib/Dwoo/Compiler.php
View file @
8eb1d240
...
@@ -2258,7 +2258,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
...
@@ -2258,7 +2258,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
$ptr
+=
2
;
$ptr
+=
2
;
}
}
if
(
in_array
(
$methodCall
[
$ptr
],
array
(
';'
,
'/'
,
' '
,
"
\t
"
,
"
\r
"
,
"
\n
"
,
')'
,
'+'
,
'*'
,
'%'
,
'='
,
'-'
,
'|'
))
||
substr
(
$methodCall
,
$ptr
,
strlen
(
$this
->
rd
))
===
$this
->
rd
)
{
if
(
in_array
(
$methodCall
[
$ptr
],
array
(
';'
,
'
,'
,
'
/'
,
' '
,
"
\t
"
,
"
\r
"
,
"
\n
"
,
')'
,
'+'
,
'*'
,
'%'
,
'='
,
'-'
,
'|'
))
||
substr
(
$methodCall
,
$ptr
,
strlen
(
$this
->
rd
))
===
$this
->
rd
)
{
// break char found
// break char found
break
;
break
;
}
}
...
...
tests/CompilerTests.php
View file @
8eb1d240
...
@@ -696,6 +696,13 @@ fail
...
@@ -696,6 +696,13 @@ fail
$tpl
->
forceCompilation
();
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
''
,
trim
(
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
)));
$this
->
assertEquals
(
''
,
trim
(
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
)));
}
}
public
function
testParsingOfMethodWithFollowingArgs
()
{
$tpl
=
new
Dwoo_Template_String
(
'{lower cat($obj->Bar("test"), "TEST")}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
'testtest'
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'obj'
=>
new
PluginHelper
()),
$this
->
compiler
));
}
}
}
function
excessArgsHelper
(
$a
)
{
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