mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
code styling
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
require "strscan"
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
FilterSeparator = /\|/
|
FilterSeparator = /\|/
|
||||||
ArgumentSeparator = ','
|
ArgumentSeparator = ','
|
||||||
@@ -44,6 +46,7 @@ module Liquid
|
|||||||
VariableParser = /\[(?>[^\[\]]+|\g<0>)*\]|#{VariableSegment}+\??/o
|
VariableParser = /\[(?>[^\[\]]+|\g<0>)*\]|#{VariableSegment}+\??/o
|
||||||
|
|
||||||
RAISE_EXCEPTION_LAMBDA = ->(_e) { raise }
|
RAISE_EXCEPTION_LAMBDA = ->(_e) { raise }
|
||||||
|
HAS_STRING_SCANNER_SCAN_BYTE = StringScanner.instance_methods.include?(:scan_byte)
|
||||||
end
|
end
|
||||||
|
|
||||||
require "liquid/version"
|
require "liquid/version"
|
||||||
|
|||||||
@@ -160,5 +160,6 @@ module Liquid
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Expression = StringScanner.instance_methods.include?(:scan_byte) ? Expression2 : Expression1
|
# Remove this once we can depend on strscan >= 3.1.1
|
||||||
|
Expression = HAS_STRING_SCANNER_SCAN_BYTE ? Expression2 : Expression1
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "strscan"
|
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
class Lexer1
|
class Lexer1
|
||||||
SPECIALS = {
|
SPECIALS = {
|
||||||
@@ -229,5 +227,5 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Remove this once we can depend on strscan >= 3.1.1
|
# Remove this once we can depend on strscan >= 3.1.1
|
||||||
Lexer = StringScanner.instance_methods.include?(:scan_byte) ? Lexer2 : Lexer1
|
Lexer = HAS_STRING_SCANNER_SCAN_BYTE ? Lexer2 : Lexer1
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user