Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
445409d5
Commit
445409d5
authored
Aug 08, 2003
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge from gotcha-talz3_backport-branch
parent
860436c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
26 deletions
+11
-26
lib/python/TAL/TALInterpreter.py
lib/python/TAL/TALInterpreter.py
+11
-26
No files found.
lib/python/TAL/TALInterpreter.py
View file @
445409d5
...
@@ -180,18 +180,7 @@ class TALInterpreter:
...
@@ -180,18 +180,7 @@ class TALInterpreter:
self
.
macroStack
.
append
([
macroName
,
slots
,
entering
,
self
.
i18nContext
])
self
.
macroStack
.
append
([
macroName
,
slots
,
entering
,
self
.
i18nContext
])
def
popMacro
(
self
):
def
popMacro
(
self
):
stuff
=
self
.
macroStack
.
pop
()
return
self
.
macroStack
.
pop
()
self
.
i18nContext
=
stuff
[
3
]
return
stuff
def
macroContext
(
self
,
what
):
macroStack
=
self
.
macroStack
i
=
len
(
macroStack
)
while
i
>
0
:
i
=
i
-
1
if
macroStack
[
i
][
0
]
==
what
:
return
i
return
-
1
def
__call__
(
self
):
def
__call__
(
self
):
assert
self
.
level
==
0
assert
self
.
level
==
0
...
@@ -292,14 +281,21 @@ class TALInterpreter:
...
@@ -292,14 +281,21 @@ class TALInterpreter:
if
_len
(
item
)
==
2
:
if
_len
(
item
)
==
2
:
name
,
s
=
item
name
,
s
=
item
else
:
else
:
ok
,
name
,
s
=
attrAction
(
self
,
item
)
# item[2] is the 'action' field:
if
item
[
2
]
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
):
if
not
self
.
showtal
:
continue
ok
,
name
,
s
=
self
.
attrAction
(
item
)
else
:
ok
,
name
,
s
=
attrAction
(
self
,
item
)
if
not
ok
:
if
not
ok
:
continue
continue
slen
=
_len
(
s
)
slen
=
_len
(
s
)
if
(
wrap
and
if
(
wrap
and
col
>=
align
and
col
>=
align
and
col
+
1
+
slen
>
wrap
):
col
+
1
+
slen
>
wrap
):
append
(
"
\
n
"
+
" "
*
align
)
append
(
"
\
n
"
)
append
(
" "
*
align
)
col
=
align
+
slen
col
=
align
+
slen
else
:
else
:
append
(
" "
)
append
(
" "
)
...
@@ -314,8 +310,7 @@ class TALInterpreter:
...
@@ -314,8 +310,7 @@ class TALInterpreter:
def
attrAction
(
self
,
item
):
def
attrAction
(
self
,
item
):
name
,
value
,
action
=
item
[:
3
]
name
,
value
,
action
=
item
[:
3
]
if
action
==
'insert'
or
(
action
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
)
if
action
==
'insert'
:
and
not
self
.
showtal
):
return
0
,
name
,
value
return
0
,
name
,
value
macs
=
self
.
macroStack
macs
=
self
.
macroStack
if
action
==
'metal'
and
self
.
metal
and
macs
:
if
action
==
'metal'
and
self
.
metal
and
macs
:
...
@@ -345,8 +340,6 @@ class TALInterpreter:
...
@@ -345,8 +340,6 @@ class TALInterpreter:
return
1
,
name
,
value
return
1
,
name
,
value
def
attrAction_tal
(
self
,
item
):
def
attrAction_tal
(
self
,
item
):
if
item
[
2
]
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
):
return
self
.
attrAction
(
item
)
name
,
value
,
action
=
item
[:
3
]
name
,
value
,
action
=
item
[:
3
]
ok
=
1
ok
=
1
expr
,
xlat
,
msgid
=
item
[
3
:]
expr
,
xlat
,
msgid
=
item
[
3
:]
...
@@ -409,14 +402,6 @@ class TALInterpreter:
...
@@ -409,14 +402,6 @@ class TALInterpreter:
self
.
do_optTag
(
stuff
)
self
.
do_optTag
(
stuff
)
bytecode_handlers
[
"optTag"
]
=
do_optTag
bytecode_handlers
[
"optTag"
]
=
do_optTag
def
dumpMacroStack
(
self
,
prefix
,
suffix
,
value
):
sys
.
stderr
.
write
(
"+---- %s%s = %s
\
n
"
%
(
prefix
,
suffix
,
value
))
for
i
in
range
(
len
(
self
.
macroStack
)):
what
,
macroName
,
slots
=
self
.
macroStack
[
i
][:
3
]
sys
.
stderr
.
write
(
"| %2d. %-12s %-12s %s
\
n
"
%
(
i
,
what
,
macroName
,
slots
and
slots
.
keys
()))
sys
.
stderr
.
write
(
"+--------------------------------------
\
n
"
)
def
do_rawtextBeginScope
(
self
,
(
s
,
col
,
position
,
closeprev
,
dict
)):
def
do_rawtextBeginScope
(
self
,
(
s
,
col
,
position
,
closeprev
,
dict
)):
self
.
_stream_write
(
s
)
self
.
_stream_write
(
s
)
self
.
col
=
col
self
.
col
=
col
...
...
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