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
257cdab5
Commit
257cdab5
authored
Aug 05, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed compiler bug that created a parse error when you had comments in an extended template
git-svn-id:
svn://dwoo.org/dwoo/trunk@144
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
39f1bcf1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
CHANGELOG
CHANGELOG
+6
-0
Compiler.php
lib/Dwoo/Compiler.php
+18
-16
No files found.
CHANGELOG
View file @
257cdab5
[
2008
-
0
-]
0.9.4
/
1.0.0
?
*
Fixed
compiler
bug
that
created
a
parse
error
when
you
had
comments
in
an
extended
template
[
2008
-
08
-
03
]
0.9.3
+
Adapters
:
Added
the
ZendFramework
interface
for
Dwoo
(
see
/
Dwoo
/
Adapters
/
ZendFramework
/
README
)
+
Plugins
:
Added
the
{
a
}
block
plugin
to
generate
<
a
>
tags
+
Syntax
:
Added
the
";"
token
that
allows
to
group
multiple
instructions
in
one
single
template
tag
,
example
:
{
if
$
foo
;
"> $foo"
;$
bar
;/}
is
equal
to
:
...
...
lib/Dwoo/Compiler.php
View file @
257cdab5
...
...
@@ -562,7 +562,23 @@ class Dwoo_Compiler implements Dwoo_ICompiler
$this
->
templateSource
=&
$tpl
;
$this
->
pointer
=&
$ptr
;
if
(
$this
->
debug
)
echo
'PROCESSING PREPROCESSORS<br>'
;
while
(
true
)
{
// if pointer is at the beginning, reset everything, that allows a plugin to externally reset the compiler if everything must be reparsed
if
(
$ptr
===
0
)
{
// resets variables
$this
->
usedPlugins
=
array
();
$this
->
data
=
array
();
$this
->
scope
=&
$this
->
data
;
$this
->
scopeTree
=
array
();
$this
->
stack
=
array
();
$this
->
line
=
1
;
// add top level block
$compiled
=
$this
->
addBlock
(
'topLevelBlock'
,
array
(),
0
);
$this
->
stack
[
0
][
'buffer'
]
=
''
;
if
(
$this
->
debug
)
echo
'COMPILER INIT<br />'
;
if
(
$this
->
debug
)
echo
'PROCESSING PREPROCESSORS ('
.
count
(
$this
->
processors
[
'pre'
])
.
')<br>'
;
// runs preprocessors
foreach
(
$this
->
processors
[
'pre'
]
as
$preProc
)
{
...
...
@@ -577,6 +593,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
unset
(
$preProc
);
// show template source if debug
if
(
$this
->
debug
)
echo
'<pre>'
.
print_r
(
htmlentities
(
$tpl
),
true
)
.
'</pre><hr />'
;
// strips comments
...
...
@@ -602,21 +619,6 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
}
while
(
true
)
{
// if pointer is at the beginning, reset everything, that allows a plugin to externally reset the compiler if everything must be reparsed
if
(
$ptr
===
0
)
{
// resets variables
$this
->
usedPlugins
=
array
();
$this
->
data
=
array
();
$this
->
scope
=&
$this
->
data
;
$this
->
scopeTree
=
array
();
$this
->
stack
=
array
();
$this
->
line
=
1
;
// add top level block
$compiled
=
$this
->
addBlock
(
'topLevelBlock'
,
array
(),
0
);
$this
->
stack
[
0
][
'buffer'
]
=
''
;
if
(
$this
->
debug
)
echo
'COMPILER INIT<br />'
;
}
$pos
=
strpos
(
$tpl
,
$this
->
ld
,
$ptr
);
...
...
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