lib/liquidscript/scanner/liquidscript.rb in liquidscript-0.6.5 vs lib/liquidscript/scanner/liquidscript.rb in liquidscript-0.7.0

- old
+ new

@@ -56,11 +56,11 @@ null true false ) - set :identifier, %r{[A-Za-z_$][A-Za-z0-9_$]*} + set :identifier, %r{[A-Za-z_$]([A-Za-z0-9_$-]*[A-Za-z0-9_$])?} on("class") { emit :class } on("module") { emit :module } on("if") { emit :if } on("unless") { emit :unless } @@ -102,10 +102,10 @@ emit :regex, [m, b] } on("///" => :block_regex) on(:binops) { |m| emit :binop, m } on(:unops) { |m| emit :unop, m } - on(:identifier) { |m| emit :identifier, m } + on(:identifier) { |m| emit :identifier, m.gsub(/\-[a-z]/) { |m| m[1].upcase } } on(%r{#! ([A-Za-z]+) ?(.*?)\n}) do |_, c, a| metadata[:directives] ||= [] metadata[:directives].push :command => c, :args => a