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

View File

@@ -22,16 +22,33 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
module Liquid
FilterSeparator = /\|/
ArgumentSeparator = ','
FilterArgumentSeparator = ':'
VariableAttributeSeparator = '.'
TagStart = /\{\%/
TagEnd = /\%\}/
VariableSignature = /\(?[\w\-\.\[\]]\)?/
VariableSegment = /[\w\-]\??/
# Basic apperence:
# Tags {% look like this %}
TagStart = /\{%/
TagEnd = /%\}/
# Variables {{look}} like {{this}}
VariableStart = /\{\{/
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 = /\}\}?/
QuotedString = /"[^"]+"|'[^']+'/
QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/