Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modify Parser class

  • Loading branch information...
commit 82beb94e0349daa1d48e5613a25a81e19b1a5dde 1 parent 10e3a4e
@fadrizul authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 lib/parser.coffee
View
22 lib/parser.coffee
@@ -15,15 +15,17 @@ class Parser
token : (type, name, args) ->
if type is x.VAR_TOKEN
- prop = "filters"
+ token =
+ type : type
+ name : name
+ filters : args
+
else
- prop = "args"
+ token =
+ type : type
+ name : name
+ args : args
- token =
- type : type
- name : name
- prop : args
-
return token
parseTokens : ->
@@ -60,10 +62,8 @@ class Parser
throw new Error("Unknown logic tag: #{tagname} ") unless (tagname of @tags)
# Create the parser tree
- token =
- type : x.LOGIC_TOKEN
- name : tagname
- args : if parts.length then parts else []
+ args = if parts.length then parts else []
+ token = @token(x.LOGIC_TOKEN, tagname, args)
# Pushes extends tag into stack
if tagname is "extends"
Please sign in to comment.
Something went wrong with that request. Please try again.