coderay 0.8.303 → 0.8.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/README +2 -1
- data/lib/coderay/duo.rb +0 -2
- data/lib/coderay/for_redcloth.rb +1 -0
- data/lib/coderay/helpers/plugin.rb +0 -2
- data/lib/coderay/scanner.rb +0 -2
- data/lib/coderay/scanners/java.rb +1 -1
- data/lib/coderay/scanners/java_script.rb +16 -8
- data/lib/coderay/scanners/nitro_xhtml.rb +0 -2
- data/lib/coderay/scanners/rhtml.rb +0 -2
- data/lib/coderay/scanners/xml.rb +0 -2
- metadata +2 -2
data/lib/README
CHANGED
@@ -18,7 +18,7 @@ And with line numbers.
|
|
18
18
|
* is what everybody should have on their website
|
19
19
|
* solves all your problems and makes the girls run after you
|
20
20
|
|
21
|
-
Version: 0.8.
|
21
|
+
Version: 0.8.3
|
22
22
|
Author:: murphy (Kornelius Kalnbach)
|
23
23
|
Contact:: murphy rubychan de
|
24
24
|
Website:: coderay.rubychan.de[http://coderay.rubychan.de]
|
@@ -87,6 +87,7 @@ Please report errors in this documentation to <murphy rubychan de>.
|
|
87
87
|
* Jonathan Younger for pointing out the licence confusion caused by wrong LICENSE file.
|
88
88
|
* Jeremy Hinegardner for finding the shebang-on-empty-file bug in FileType.
|
89
89
|
* Charles Oliver Nutter and Yehuda Katz for helping me benchmark CodeRay on JRuby.
|
90
|
+
* Andreas Neuhaus for pointing out a markup bug in coderay/for_redcloth.
|
90
91
|
* The folks at redmine.org - thank you for using and fixing CodeRay!
|
91
92
|
* matz and all Ruby gods and gurus
|
92
93
|
* The inventors of: the computer, the internet, the true color display, HTML &
|
data/lib/coderay/duo.rb
CHANGED
@@ -2,8 +2,6 @@ module CodeRay
|
|
2
2
|
|
3
3
|
# = Duo
|
4
4
|
#
|
5
|
-
# $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $
|
6
|
-
#
|
7
5
|
# A Duo is a convenient way to use CodeRay. You just create a Duo,
|
8
6
|
# giving it a lang (language of the input code) and a format (desired
|
9
7
|
# output format), and call Duo#highlight with the code.
|
data/lib/coderay/for_redcloth.rb
CHANGED
data/lib/coderay/scanner.rb
CHANGED
@@ -76,7 +76,7 @@ module Scanners
|
|
76
76
|
class_name_follows = false
|
77
77
|
else
|
78
78
|
import_clause = true if match == 'import'
|
79
|
-
class_name_follows = true if match == 'class'
|
79
|
+
class_name_follows = true if match == 'class' || match == 'interface'
|
80
80
|
end
|
81
81
|
|
82
82
|
elsif scan(/ \.(?!\d) | [,?:(\[)\]}] | -- | \+\+ | && | \|\| | \*\*=? | [-+*\/%^~&|<>=!]=? | <<<?=? | >>>?=? /x)
|
@@ -42,6 +42,10 @@ module Scanners
|
|
42
42
|
'"' => /[^\\"]+/,
|
43
43
|
'/' => /[^\\\/]+/,
|
44
44
|
}
|
45
|
+
KEY_CHECK_PATTERN = {
|
46
|
+
"'" => / [^\\']* (?: \\.? [^\\']* )* '? \s* : /x,
|
47
|
+
'"' => / [^\\"]* (?: \\.? [^\\"]* )* "? \s* : /x,
|
48
|
+
}
|
45
49
|
|
46
50
|
def scan_tokens tokens, options
|
47
51
|
|
@@ -103,8 +107,12 @@ module Scanners
|
|
103
107
|
key_expected = false
|
104
108
|
|
105
109
|
elsif match = scan(/["']/)
|
106
|
-
|
107
|
-
|
110
|
+
if key_expected && check(KEY_CHECK_PATTERN[match])
|
111
|
+
state = :key
|
112
|
+
else
|
113
|
+
state = :string
|
114
|
+
end
|
115
|
+
tokens << [:open, state]
|
108
116
|
string_delimiter = match
|
109
117
|
kind = :delimiter
|
110
118
|
|
@@ -125,7 +133,7 @@ module Scanners
|
|
125
133
|
|
126
134
|
end
|
127
135
|
|
128
|
-
when :string, :regexp
|
136
|
+
when :string, :regexp, :key
|
129
137
|
if scan(STRING_CONTENT_PATTERN[string_delimiter])
|
130
138
|
kind = :content
|
131
139
|
elsif match = scan(/["'\/]/)
|
@@ -139,7 +147,7 @@ module Scanners
|
|
139
147
|
key_expected = value_expected = false
|
140
148
|
state = :initial
|
141
149
|
next
|
142
|
-
elsif state
|
150
|
+
elsif state != :regexp && (match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox))
|
143
151
|
if string_delimiter == "'" && !(match == "\\\\" || match == "\\'")
|
144
152
|
kind = :content
|
145
153
|
else
|
@@ -155,20 +163,20 @@ module Scanners
|
|
155
163
|
key_expected = value_expected = false
|
156
164
|
state = :initial
|
157
165
|
else
|
158
|
-
raise_inspect "else case \" reached; %p not handled." % peek(1), tokens
|
166
|
+
raise_inspect "else case \" reached; %p not handled." % peek(1), tokens, state
|
159
167
|
end
|
160
168
|
|
161
169
|
else
|
162
|
-
raise_inspect 'Unknown state', tokens
|
170
|
+
raise_inspect 'Unknown state', tokens, state
|
163
171
|
|
164
172
|
end
|
165
173
|
|
166
174
|
match ||= matched
|
167
175
|
if $DEBUG and not kind
|
168
176
|
raise_inspect 'Error token %p in line %d' %
|
169
|
-
[[match, kind], line], tokens
|
177
|
+
[[match, kind], line], tokens, state
|
170
178
|
end
|
171
|
-
raise_inspect 'Empty token', tokens unless match
|
179
|
+
raise_inspect 'Empty token', tokens, state unless match
|
172
180
|
|
173
181
|
tokens << [match, kind]
|
174
182
|
|
data/lib/coderay/scanners/xml.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coderay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.312
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- murphy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-23 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|