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
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
require "strscan"
|
||||
|
||||
module Liquid
|
||||
FilterSeparator = /\|/
|
||||
ArgumentSeparator = ','
|
||||
@@ -44,6 +46,7 @@ module Liquid
|
||||
VariableParser = /\[(?>[^\[\]]+|\g<0>)*\]|#{VariableSegment}+\??/o
|
||||
|
||||
RAISE_EXCEPTION_LAMBDA = ->(_e) { raise }
|
||||
HAS_STRING_SCANNER_SCAN_BYTE = StringScanner.instance_methods.include?(:scan_byte)
|
||||
end
|
||||
|
||||
require "liquid/version"
|
||||
|
||||
@@ -160,5 +160,6 @@ module Liquid
|
||||
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
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "strscan"
|
||||
|
||||
module Liquid
|
||||
class Lexer1
|
||||
SPECIALS = {
|
||||
@@ -229,5 +227,5 @@ module Liquid
|
||||
end
|
||||
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user