lib/treetop/compiler/node_classes/character_class.rb in treetop-1.5.1 vs lib/treetop/compiler/node_classes/character_class.rb in treetop-1.5.3
- old
+ new
@@ -9,20 +9,20 @@
assign_result "instantiate_node(#{node_class_name},input, index...(index + 1))"
extend_result_with_inline_module
else
assign_lazily_instantiated_node
end
- builder << "@index += 1"
+ builder << "@index += 1" # Always one character
end
builder.else_ do
- # "terminal_parse_failure(#{single_quote(characters)})"
+ builder << "terminal_parse_failure(#{single_quote('['+characters+']')})"
assign_result 'nil'
end
end
def grounded_regexp(string)
# Double any backslashes, then backslash any single-quotes:
- "'\\G#{string.gsub(/\\/) { '\\\\' }.gsub(/'/) { "\\'"}}'"
+ "'\\A#{string.gsub(/\\/) { '\\\\' }.gsub(/'/) { "\\'"}}'"
end
end
end
end