Skip to content

Commit

Permalink
Merge 90e3bef into af878ff
Browse files Browse the repository at this point in the history
  • Loading branch information
marclaval committed Sep 16, 2014
2 parents af878ff + 90e3bef commit fda74b8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hsp/compiler/parser/hspblocks.pegjs
Expand Up @@ -198,7 +198,7 @@ HTMLName
{return first + next.join("");}

HTMLAttName
= first:[a-zA-Z#] next:([a-zA-Z] / [0-9] / "-")*
= first:[a-zA-Z#] next:([a-zA-Z] / [0-9] / "-" / ":")*
// uppercase chars are considered as error in the parse post-processor
{return first + next.join("");}

Expand All @@ -218,7 +218,8 @@ HTMLAttributeText
HTMLAttributeChar // TODO look at W3C specs
= "\\{" {return "\u007B"} // { = \u007B
/ "\\\"" {return "\""}
/ [^{\"\n\r]
/ EOL {return "\\n"}
/ [^{\"]

LogBlock
= "{" _ "log " _ first:CoreExpText _ next:("," _ CoreExpText)* _"}" EOS?
Expand Down
46 changes: 46 additions & 0 deletions test/compiler/samples/element6.txt
@@ -0,0 +1,46 @@
##### Template:
{template svg()}
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 512 512"
enable-background="new 0 0 512 512"
xml:space="preserve">
<path id="smiley-rofl-icon"
d="M462,256c0-113.771-92.229-206-206-206C142.229,50,50,142.229,50,256c0,113.771,92.229,206,206,206
C369.771,462,462,369.771,462,256z M90,256c0-91.74,74.243-166,166-166c91.741,0,166,74.244,166,166c0,91.741-74.243,166-166,166
C164.258,422,90,347.757,90,256z M223.923,364.519c-25.399-7.35-74.153-49.73-74.153-106.521c0-56.791,48.754-99.171,74.153-106.521
V364.519z M289.865,366.839c-2.337-3.373-9.787-14.568-9.787-14.568s18.324-9.715,18.324-33.716 c0-23.332-18.324-33.716-18.324-33.716s7.45-11.195,9.787-14.568c14.444,5.45,38.676,23.283,38.676,48.284
S304.31,361.389,289.865,366.839z M289.865,248.046c-2.337-3.373-9.787-14.568-9.787-14.568s18.324-9.715,18.324-33.716 c0-23.332-18.324-33.716-18.324-33.716s7.45-11.195,9.787-14.568c14.444,5.45,38.676,23.283,38.676,48.284
S304.31,242.596,289.865,248.046z"></path>
</svg>
{/template}

##### Parsed Tree
"skip"

##### Syntax Tree
"skip"

##### Template Code
svg=[__s,
n.elt("svg",0,
{"version":"1.1",
"xmlns":"http://www.w3.org/2000/svg",
"xmlns:xlink":"http://www.w3.org/1999/xlink",
"x":"0px",
"y":"0px",
"viewBox":"0 0 512 512",
"enable-background":"new 0 0 512 512",
"xml:space":"preserve"},0,
[
n.elt("path",0,
{"id":"smiley-rofl-icon","d":"M462,256c0-113.771-92.229-206-206-206C142.229,50,50,142.229,50,256c0,113.771,92.229,206,206,206\n
C369.771,462,462,369.771,462,256z M90,256c0-91.74,74.243-166,166-166c91.741,0,166,74.244,166,166c0,91.741-74.243,166-166,166\n
C164.258,422,90,347.757,90,256z M223.923,364.519c-25.399-7.35-74.153-49.73-74.153-106.521c0-56.791,48.754-99.171,74.153-106.521\n
V364.519z M289.865,366.839c-2.337-3.373-9.787-14.568-9.787-14.568s18.324-9.715,18.324-33.716 c0-23.332-18.324-33.716-18.324-33.716s7.45-11.195,9.787-14.568c14.444,5.45,38.676,23.283,38.676,48.284\n
S304.31,361.389,289.865,366.839z M289.865,248.046c-2.337-3.373-9.787-14.568-9.787-14.568s18.324-9.715,18.324-33.716 c0-23.332-18.324-33.716-18.324-33.716s7.45-11.195,9.787-14.568c14.444,5.45,38.676,23.283,38.676,48.284\n
S304.31,242.596,289.865,248.046z"
},0)
]
)
]

0 comments on commit fda74b8

Please sign in to comment.