summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/scanners')
-rw-r--r--lib/coderay/scanners/delphi.rb3
-rw-r--r--lib/coderay/scanners/html.rb3
-rw-r--r--lib/coderay/scanners/nitro_xhtml.rb3
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/coderay/scanners/delphi.rb b/lib/coderay/scanners/delphi.rb
index c141874..fb37f67 100644
--- a/lib/coderay/scanners/delphi.rb
+++ b/lib/coderay/scanners/delphi.rb
@@ -101,6 +101,7 @@ module Scanners
state = :initial
next
elsif scan(/\n/)
+ kind = :error
state = :initial
else
raise "else case \' reached; %p not handled." % peek(1), tokens
@@ -114,7 +115,7 @@ module Scanners
match ||= matched
if $DEBUG and not kind
raise_inspect 'Error token %p in line %d' %
- [[match, kind], line], tokens
+ [[match, kind], line], tokens, state
end
raise_inspect 'Empty token', tokens unless match
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb
index 181e5d3..5f647d3 100644
--- a/lib/coderay/scanners/html.rb
+++ b/lib/coderay/scanners/html.rb
@@ -107,6 +107,7 @@ module Scanners
kind = :tag
state = :initial
elsif scan(/./)
+ kind = :error
state = :attribute
end
@@ -137,6 +138,8 @@ module Scanners
next
elsif scan(/#{ENTITY}/ox)
kind = :entity
+ elsif scan(/&/)
+ kind = :content
elsif scan(/[\n>]/)
tokens << [:close, :string]
kind = :error
diff --git a/lib/coderay/scanners/nitro_xhtml.rb b/lib/coderay/scanners/nitro_xhtml.rb
index baef162..19354d9 100644
--- a/lib/coderay/scanners/nitro_xhtml.rb
+++ b/lib/coderay/scanners/nitro_xhtml.rb
@@ -113,6 +113,9 @@ module Scanners
elsif entity = scan(/#{NITRO_ENTITY}/o)
tokens << [entity, :entity]
+
+ elsif scan(/%/)
+ tokens << [matched, :error]
else
raise_inspect 'else-case reached!', tokens