lib/ver/syntax/processor.rb in ver-2010.02 vs lib/ver/syntax/processor.rb in ver-2010.08
- old
+ new
@@ -3,10 +3,11 @@
class Processor < Struct.new(:textarea, :theme, :lineno, :stack, :tags)
def start_parsing(syntax_name)
self.stack = []
self.tags = Hash.new{|h,k| h[k] = [] }
@tag_stack = []
+ tags[syntax_name] << "1.0" << "end"
end
def end_parsing(syntax_name)
tags.each do |name, indices|
tag_name = theme.get(name) || name
@@ -43,10 +44,10 @@
rescue RuntimeError => exception
# if you modify near the end of the textarea, sometimes the last tag
# cannot be closed because the contents of the textarea changed since
# the last highlight was issued.
# this will cause Tk to raise an error that doesn't have a message and
- # is of no major consequences.
+ # is of no major conpatterns.
# We swallow that exception to avoid confusion.
raise exception unless exception.message.empty?
end
end
end