mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Some more documentation for regexpes
This commit is contained in:
+25
-8
@@ -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})+/
|
||||||
|
|||||||
Reference in New Issue
Block a user