Some more documentation for regexpes

This commit is contained in:
Tobias Lütke
2009-04-06 08:45:04 -06:00
parent 075341d01c
commit 68433a52a3
+25 -8
View File
@@ -22,16 +22,33 @@
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.dirname(__FILE__))
module Liquid module Liquid
FilterSeparator = /\|/
ArgumentSeparator = ',' # Basic apperence:
FilterArgumentSeparator = ':'
VariableAttributeSeparator = '.' # Tags {% look like this %}
TagStart = /\{\%/ TagStart = /\{%/
TagEnd = /\%\}/ TagEnd = /%\}/
VariableSignature = /\(?[\w\-\.\[\]]\)?/
VariableSegment = /[\w\-]\??/ # Variables {{look}} like {{this}}
VariableStart = /\{\{/ VariableStart = /\{\{/
VariableEnd = /\}\}/ VariableEnd = /\}\}/
# Arguments are passed {% like: this %}
FilterArgumentSeparator = ':'
# Hashes are separated {{ like.this }}
VariableAttributeSeparator = '.'
# Filters are piped in {{ like | this }}
FilterSeparator = /\|/
# Muliple arguments are {% separated: like, this %}
ArgumentSeparator = ','
# Lexical parsing regexped go below.
VariableSignature = /\(?[\w\-\.\[\]]\)?/
VariableSegment = /[\w\-]\??/
VariableIncompleteEnd = /\}\}?/ VariableIncompleteEnd = /\}\}?/
QuotedString = /"[^"]+"|'[^']+'/ QuotedString = /"[^"]+"|'[^']+'/
QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/ QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/