Skip to content

Commit

Permalink
Removed need for pipes in filters. Closes #185
Browse files Browse the repository at this point in the history
filers that act on the AST will need a different syntax
  • Loading branch information
tj committed Mar 24, 2011
1 parent 4d7f0d9 commit edef39d
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,26 +246,19 @@ Parser.prototype = {
},

/**
* filter attrs? (text | block)
* filter attrs? text-block
*/

parseFilter: function(){
var block
, tok = this.expect('filter')
, attrs = this.accept('attrs');

if ('text' == tok.val) {
this.lexer.textPipe = false;
block = this.parseTextBlock();
this.lexer.textPipe = true;
return block;
} else if ('text' == this.lookahead(2).type) {
block = this.parseTextBlock();
} else {
block = this.parseBlock();
}
this.lexer.textPipe = false;
block = this.parseTextBlock();
this.lexer.textPipe = true;

var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
var node = new nodes.Filter(tok.val, block);
node.line = this.line();
return node;
},
Expand Down

0 comments on commit edef39d

Please sign in to comment.