Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
6240fe23
Commit
6240fe23
authored
Jan 14, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Broke # and ^ into separate cases.
parent
d6880870
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
pystache/parser.py
+10
-7
No files found.
pystache/parser.py
View file @
6240fe23
...
...
@@ -126,7 +126,7 @@ class Parser(object):
match_index
+=
len
(
leading_whitespace
)
leading_whitespace
=
''
index
=
self
.
_handle_
match
(
template
,
parse_tree
,
tag_type
,
tag_key
,
leading_whitespace
,
start_index
,
match_index
,
end_index
)
index
=
self
.
_handle_
tag_type
(
template
,
parse_tree
,
tag_type
,
tag_key
,
leading_whitespace
,
start_index
,
match_index
,
end_index
)
# Save the rest of the template.
parse_tree
.
append
(
template
[
index
:])
...
...
@@ -143,7 +143,7 @@ class Parser(object):
return
buff
,
template
,
index_end
def
_handle_
match
(
self
,
template
,
parse_tree
,
tag_type
,
tag_key
,
leading_whitespace
,
start_index
,
match_index
,
end_index
):
def
_handle_
tag_type
(
self
,
template
,
parse_tree
,
tag_type
,
tag_key
,
leading_whitespace
,
start_index
,
match_index
,
end_index
):
if
tag_type
==
'!'
:
return
end_index
...
...
@@ -156,15 +156,18 @@ class Parser(object):
engine
=
self
.
engine
if
tag_type
==
'>'
:
func
=
engine
.
_make_get_partial
(
tag_key
,
leading_whitespace
)
elif
tag_type
in
[
'#'
,
'^'
]:
elif
tag_type
==
'#'
:
buff
,
template
,
end_index
=
self
.
_parse_section
(
template
,
end_index
)
func
=
engine
.
_make_get_section
(
tag_key
,
buff
,
template
,
self
.
_delimiters
)
if
tag_type
==
'#
'
:
func
=
engine
.
_make_get_section
(
tag_key
,
buff
,
template
,
self
.
_delimiters
)
else
:
func
=
engine
.
_make_get_inverse
(
tag_key
,
buff
)
elif
tag_type
==
'^
'
:
buff
,
template
,
end_index
=
self
.
_parse_section
(
template
,
end_index
)
func
=
engine
.
_make_get_inverse
(
tag_key
,
buff
)
elif
tag_type
==
'&'
:
...
...
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