mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Rename HashParser to AttributeParser
since this module can parse both hash and hash without bracket.
This commit is contained in:
parent
d927931578
commit
faa518b3a3
3 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
require 'hamlit/ruby_expression'
|
||||
|
||||
module Hamlit
|
||||
class HashParser
|
||||
class AttributeParser
|
||||
class ParseSkip < StandardError
|
||||
end
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
require 'hamlit/attribute_builder'
|
||||
require 'hamlit/hash_parser'
|
||||
require 'hamlit/attribute_parser'
|
||||
require 'hamlit/ruby_expression'
|
||||
require 'hamlit/static_analyzer'
|
||||
require 'hamlit/string_interpolation'
|
||||
|
@ -18,7 +18,7 @@ module Hamlit
|
|||
hashes = []
|
||||
return runtime_compile(node) if node.value[:object_ref] != :nil
|
||||
node.value[:attributes_hashes].each do |attribute_str|
|
||||
hash = HashParser.parse(attribute_str)
|
||||
hash = AttributeParser.parse(attribute_str)
|
||||
return runtime_compile(node) unless hash
|
||||
hashes << hash
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
describe Hamlit::HashParser do
|
||||
describe Hamlit::AttributeParser do
|
||||
describe '.parse' do
|
||||
def assert_parse(expected, haml)
|
||||
actual = Hamlit::HashParser.parse(haml)
|
||||
actual = Hamlit::AttributeParser.parse(haml)
|
||||
assert_equal expected, actual
|
||||
end
|
||||
|
Loading…
Reference in a new issue