Project

General

Profile

Changelog » History » Version 2

Kornelius Kalnbach, 06/11/2010 01:27 PM

1 1 Kornelius Kalnbach
h1=. CodeRay Version History
2 1 Kornelius Kalnbach
 
3 1 Kornelius Kalnbach
p=. _This files lists all changes in the CodeRay library since the 0.8.4 release._
4 1 Kornelius Kalnbach
 
5 2 Kornelius Kalnbach
{{toc}}
6 2 Kornelius Kalnbach
 
7 1 Kornelius Kalnbach
h2. Changes in 1.0
8 1 Kornelius Kalnbach
 
9 1 Kornelius Kalnbach
h3. Direct Streaming
10 1 Kornelius Kalnbach
 
11 1 Kornelius Kalnbach
CodeRay 1.0 introduces _Direct Streaming_ as a faster and simpler alternative to Tokens. It means that all Scanners, Encoders and Filters had to be rewritten, and that older scanners using the Tokens API are no longer compatible with this version.
12 1 Kornelius Kalnbach
 
13 1 Kornelius Kalnbach
The benefit of this change is more speed (benchmarks show 10% to 50% more tokens per second compared to CodeRay 0.9), a simpler API, and less code.
14 1 Kornelius Kalnbach
 
15 1 Kornelius Kalnbach
Changes related to the new tokens handling include:
16 1 Kornelius Kalnbach
* *CHANGED*: The Scanners now call Encoders directly; tokens are not added to a Tokens array, but are send to the Encoder as a method call. The Tokens representation (which can be seen as a cache now) is still present, but as a special case; Tokens just encodes the given tokens into an Array for later use.
17 1 Kornelius Kalnbach
* *CHANGED*: The token actions (@text_token@, @begin_group@ etc.) are now public methods of @Encoder@ and @Tokens@.
18 1 Kornelius Kalnbach
* *REWRITE* of all Scanners, Encoders, Filters, and Tokens.
19 1 Kornelius Kalnbach
* *RENAMED* @:open@ and @:close@ actions to @:begin_group@ and @:end_group@.
20 1 Kornelius Kalnbach
* *RENAMED* @open_token@ and @close_token@ methods to @begin_group@ and @end_group@.
21 1 Kornelius Kalnbach
* *NEW* method @#tokens@ allows to add several tokens to the stream. @Tokens@ and @Encoders::Encoder@ define this method.
22 1 Kornelius Kalnbach
* *CHANGED* The above name changes also affect the JSON, XML, and YAML encoders. CodeRay 1.0 output will be incompatible with earlier versions.
23 1 Kornelius Kalnbach
* *REMOVED* @TokenStream@ and the @Streamable@ API and all related features like @NotStreamableError@ are now obsolete and have been removed.
24 1 Kornelius Kalnbach
25 1 Kornelius Kalnbach
h3. General changes
26 1 Kornelius Kalnbach
 
27 1 Kornelius Kalnbach
* *IMPROVED* documentation in general; additions, corrections and cleanups
28 1 Kornelius Kalnbach
* *FIXED* some image links in the documentation
29 1 Kornelius Kalnbach
* *IMPROVED* Ruby 1.9 support (_._ not in @$LOAD_PATH@)
30 1 Kornelius Kalnbach
31 1 Kornelius Kalnbach
h3. @Tokens@
32 1 Kornelius Kalnbach
 
33 1 Kornelius Kalnbach
* *REMOVED* methods @#stream?@, @#each_text_token@.
34 1 Kornelius Kalnbach
* *REMOVED* @#text@ and @#text_size@ methods. Use the @Text@ encoder instead.
35 1 Kornelius Kalnbach
* *REMOVED* special implementation of @#each@ taking a filter parameter. Use @TokenKindFilter@ instead.
36 1 Kornelius Kalnbach
* *NEW* methods @encode_with@, @count@, @begin_group@, @end_group@, @begin_line@, and @end_line@.
37 1 Kornelius Kalnbach
38 1 Kornelius Kalnbach
h3. *RENAMED*: @Tokens::AbbreviationForKind@
39 1 Kornelius Kalnbach
 
40 1 Kornelius Kalnbach
Renamed from @ClassOfKind@; the term "token class" is no longer used in CodeRay. Instead, tokens have _kinds_.
41 1 Kornelius Kalnbach
See "#122":http://redmine.rubychan.de/issues/122.
42 1 Kornelius Kalnbach
 
43 1 Kornelius Kalnbach
* *REMOVED* token kinds @:attribute_name_fat@, @:attribute_value_fat@, @:operator_fat@, @:tag_fat@, @:xml_text@, @:open@, and @:close@.
44 1 Kornelius Kalnbach
* *ADDED* token kinds @:filename@, @:namespace@, and @:eyecatcher@.
45 1 Kornelius Kalnbach
* *CHANGED*: Don't raise error for unknown token kinds unless in @$CODERAY_DEBUG@ mode.
46 1 Kornelius Kalnbach
47 1 Kornelius Kalnbach
h3. @Encoders::CommentFilter@
48 1 Kornelius Kalnbach
 
49 1 Kornelius Kalnbach
* *NEW* alias @:remove_comments@
50 1 Kornelius Kalnbach
51 1 Kornelius Kalnbach
h3. @Encoders::Filter@
52 1 Kornelius Kalnbach
 
53 1 Kornelius Kalnbach
* *NEW* option @tokens@.
54 1 Kornelius Kalnbach
* *CHANGED*: Now it simply delegates to the output.
55 1 Kornelius Kalnbach
* *REMOVED* @include_text_token?@ and @include_block_token?@ methods.
56 1 Kornelius Kalnbach
57 1 Kornelius Kalnbach
h3. @Encoders::HTML@
58 1 Kornelius Kalnbach
 
59 1 Kornelius Kalnbach
The HTML encoder was cleaned up and simplified.
60 1 Kornelius Kalnbach
 
61 1 Kornelius Kalnbach
* *CHANGED* the default style to @:alpha@.
62 1 Kornelius Kalnbach
* *NEW*: HTML 5 and CSS 3 compatible, IE incompatible.
63 1 Kornelius Kalnbach
  See "#215":http://redmine.rubychan.de/issues/215.
64 1 Kornelius Kalnbach
* *ADDED* support for @:line_number_anchors@.
65 1 Kornelius Kalnbach
  See "#208":http://redmine.rubychan.de/issues/208.
66 1 Kornelius Kalnbach
* *CHANGED*: Use double click to toggle line numbers in table mode (as single 
67 1 Kornelius Kalnbach
  click jumps to an anchor.)
68 1 Kornelius Kalnbach
* *REMOVED* support for @:line_numbers => :list@.
69 1 Kornelius Kalnbach
* *FIXED* splitting of lines for @:line_numbers => :inline@, so that the line
70 1 Kornelius Kalnbach
  numbers don't get colored, too.
71 1 Kornelius Kalnbach
* *RENAMED* @Output#numerize@ to @#number@, which is an actual English word.
72 1 Kornelius Kalnbach
73 1 Kornelius Kalnbach
h3. @Encoders::LinesOfCode@
74 1 Kornelius Kalnbach
 
75 1 Kornelius Kalnbach
* *CHANGED*: @compile@ and @finish@ methods are now protected.
76 1 Kornelius Kalnbach
77 1 Kornelius Kalnbach
h3. @Encoders::Terminal@
78 1 Kornelius Kalnbach
 
79 1 Kornelius Kalnbach
* *RENAMED* from @Encoders::Term@, added @:term@ alias.
80 1 Kornelius Kalnbach
* *CLEANUP*: Use @#setup@'s @super@, don't use @:procedure@ token class.
81 1 Kornelius Kalnbach
* *CHANGED*: @#token@'s second parameter is no longer optional.
82 1 Kornelius Kalnbach
* *REMOVED* colors for obsolete token kinds.
83 1 Kornelius Kalnbach
* *FIXED* handling of line tokens.
84 1 Kornelius Kalnbach
85 1 Kornelius Kalnbach
h3. @Encoders::Text@
86 1 Kornelius Kalnbach
 
87 1 Kornelius Kalnbach
* *FIXED* default behavior of stripping the trailing newline.
88 1 Kornelius Kalnbach
89 1 Kornelius Kalnbach
h3. *RENAMED*: @Encoders::TokenKindFilter@
90 1 Kornelius Kalnbach
 
91 1 Kornelius Kalnbach
Renamed from @TokenClassFilter@.
92 2 Kornelius Kalnbach
 
93 1 Kornelius Kalnbach
* *NEW*: Handles token groups.
94 1 Kornelius Kalnbach
  See "#223":http://redmine.rubychan.de/issues/223.
95 1 Kornelius Kalnbach
* *RENAMED* @include_block_token?@ to @include_group?@.
96 1 Kornelius Kalnbach
97 1 Kornelius Kalnbach
h3. @Encoders::Statistic@
98 1 Kornelius Kalnbach
 
99 1 Kornelius Kalnbach
* *CHANGED*: Tokens actions are counted separately.
100 1 Kornelius Kalnbach
101 1 Kornelius Kalnbach
h3. @Encoders::YAML@
102 1 Kornelius Kalnbach
 
103 1 Kornelius Kalnbach
* *NEW* method @call@ for allowing code like @CodeRay::Duo[:python => :yaml].(code)@ in Ruby 1.9.
104 1 Kornelius Kalnbach
105 1 Kornelius Kalnbach
h3. @Scanners::Scanner@
106 1 Kornelius Kalnbach
 
107 1 Kornelius Kalnbach
* *REMOVED* helper method @String#to_unix@.
108 1 Kornelius Kalnbach
* *REMOVED* method @streamable?@.
109 1 Kornelius Kalnbach
* *NEW*: The @#tokenize@ method also takes an Array of Strings as source. The
110 1 Kornelius Kalnbach
  code is highlighted as one and split into parts of the input lengths
111 1 Kornelius Kalnbach
  after that using @Tokens#split_into_parts@.
112 1 Kornelius Kalnbach
113 1 Kornelius Kalnbach
h3. @Scanners::CSS@
114 1 Kornelius Kalnbach
 
115 1 Kornelius Kalnbach
* *NEW*: Rudimentary support for the @attr@, @counter@, and @counters@ functions.
116 1 Kornelius Kalnbach
  See "#224":http://redmine.rubychan.de/issues/224.
117 1 Kornelius Kalnbach
* *NEW*: Rudimentary support for CSS 3 colors.
118 1 Kornelius Kalnbach
* *CHANGED*: Attribute selectors are highlighted as @:attribute_name@ instead of @:string@.
119 1 Kornelius Kalnbach
120 1 Kornelius Kalnbach
h3. @Scanners::Debug@
121 1 Kornelius Kalnbach
 
122 1 Kornelius Kalnbach
* *NEW*: Support for line tokens (@begin_line@ and @end_line@ represented by @[@ and @]@.)
123 1 Kornelius Kalnbach
* *FIXED*: Don't send @:error@ and @nil@ tokens for buggy input any more.
124 1 Kornelius Kalnbach
* *FIXED*: Closes unclosed tokens at the end of @scan_tokens@.
125 1 Kornelius Kalnbach
* *IMPROVED*: Highlight unknown tokens as @:error@.
126 1 Kornelius Kalnbach
* *CHANGED*: Raises an error when trying to end an invalid token group.
127 1 Kornelius Kalnbach
128 1 Kornelius Kalnbach
h3. @Scanners::Delphi@
129 1 Kornelius Kalnbach
 
130 1 Kornelius Kalnbach
* *FIXED*: Closes open string groups.
131 1 Kornelius Kalnbach
132 1 Kornelius Kalnbach
h3. @Scanners::Diff@
133 1 Kornelius Kalnbach
 
134 1 Kornelius Kalnbach
* *NEW*: Highlighting of code based on file names.
135 1 Kornelius Kalnbach
  See ticket "#52":http://redmine.rubychan.de/issues/52.
136 1 Kornelius Kalnbach
  
137 1 Kornelius Kalnbach
  Use the @:highlight_code@ option to turn this feature off. It's enabled
138 1 Kornelius Kalnbach
  by default.
139 1 Kornelius Kalnbach
  
140 1 Kornelius Kalnbach
  This is a very original feature. It enables multi-language highlighting for
141 1 Kornelius Kalnbach
  diff files, which is especially helpful for CodeRay development itself. The
142 1 Kornelius Kalnbach
  updated version of the scanner test suite generated .debug.diff.html files
143 1 Kornelius Kalnbach
  using this.
144 1 Kornelius Kalnbach
  
145 1 Kornelius Kalnbach
  Note: This is still experimental. Tokens spanning more than one line
146 1 Kornelius Kalnbach
  may get highlighted incorrectly. CodeRay tries to keep scanner states
147 1 Kornelius Kalnbach
  between the lines and changes, but the quality of the results depend on
148 1 Kornelius Kalnbach
  the scanner.
149 1 Kornelius Kalnbach
* *NEW*: Inline change highlighting, as suggested by Eric Thomas.
150 1 Kornelius Kalnbach
  See ticket "#227":http://redmine.rubychan.de/issues/227 for details.
151 1 Kornelius Kalnbach
  
152 1 Kornelius Kalnbach
  Use the @:inline_diff@ option to turn this feature off. It's enabled by
153 1 Kornelius Kalnbach
  default.
154 1 Kornelius Kalnbach
  
155 1 Kornelius Kalnbach
  For single-line changes (that is, a single deleted line followed by a single
156 1 Kornelius Kalnbach
  inserted line), this feature surrounds the changed parts with an
157 1 Kornelius Kalnbach
  @:eyecatcher@ group which appears in a more saturated background color.
158 1 Kornelius Kalnbach
  The implementation is quite complex, and highly experimental. The problem
159 1 Kornelius Kalnbach
  with multi-layer tokenizing is that the tokens have to be split into parts.
160 1 Kornelius Kalnbach
  If the inline change starts, say, in the middle of a string, then additional
161 1 Kornelius Kalnbach
  @:end_group@ and @:begin_group@ tokens must be inserted to keep the group
162 1 Kornelius Kalnbach
  nesting intact. The extended @Scanner#tokenize@ method and the new
163 1 Kornelius Kalnbach
  @Tokens#split_into_parts@ method take care of this.
164 1 Kornelius Kalnbach
* *NEW*: Highlight the file name in the change headers as @:filename@.
165 1 Kornelius Kalnbach
* *CHANGED*: Highlight unknown lines as @:comment@ instead of @:head@.
166 1 Kornelius Kalnbach
167 1 Kornelius Kalnbach
h3. @Scanners::HTML@
168 1 Kornelius Kalnbach
 
169 1 Kornelius Kalnbach
* *FIXED*: Closes open string groups.
170 1 Kornelius Kalnbach
171 1 Kornelius Kalnbach
h3. @Scanners::JavaScript@
172 1 Kornelius Kalnbach
 
173 1 Kornelius Kalnbach
* *IMPROVED*: Added @NaN@ and @Infinity@ to list of predefined constants.
174 1 Kornelius Kalnbach
175 1 Kornelius Kalnbach
h3. @Scanners::Java@
176 1 Kornelius Kalnbach
 
177 1 Kornelius Kalnbach
* *NEW*: Package names are highlighted as @:namespace@.
178 1 Kornelius Kalnbach
  See "#210":http://redmine.rubychan.de/issues/210.
179 1 Kornelius Kalnbach
180 1 Kornelius Kalnbach
h3. @Scanners::Plaintext@
181 1 Kornelius Kalnbach
 
182 1 Kornelius Kalnbach
* *IMPROVED*: Just returns the string without scanning (faster).
183 1 Kornelius Kalnbach
 
184 1 Kornelius Kalnbach
 This is much faster than scanning until @/\z/@ in Ruby 1.8.
185 1 Kornelius Kalnbach
186 1 Kornelius Kalnbach
h3. @Scanners::Python@
187 1 Kornelius Kalnbach
 
188 1 Kornelius Kalnbach
* *CHANGED*: Docstrings are highlighted as @:comment@.
189 1 Kornelius Kalnbach
  See "#190":http://redmine.rubychan.de/issues/190.
190 1 Kornelius Kalnbach
191 1 Kornelius Kalnbach
h3. *NEW*: @Scanners::Raydebug@
192 1 Kornelius Kalnbach
 
193 1 Kornelius Kalnbach
Copied from @Scanners::Debug@, highlights the token dump instead of importing it. It also reacts to the @.raydebug@ file name suffix now.
194 1 Kornelius Kalnbach
195 1 Kornelius Kalnbach
h3. @Scanners::Ruby@
196 1 Kornelius Kalnbach
 
197 1 Kornelius Kalnbach
* *ADDED* more predefined keywords (see http://murfy.de/ruby-constants).
198 1 Kornelius Kalnbach
* *IMPROVED* support for singleton method definitions.
199 1 Kornelius Kalnbach
  See "#147":http://redmine.rubychan.de/issues/147.
200 1 Kornelius Kalnbach
* *FIXED*: Don't highlight methods with a capital letter as constants
201 1 Kornelius Kalnbach
  (eg. GL.PushMatrix).
202 1 Kornelius Kalnbach
* *NEW*: Highlight buggy floats (like .5) as @:error@.
203 1 Kornelius Kalnbach
* *CLEANUP* of documentation, names of constants and variables, state handling.
204 1 Kornelius Kalnbach
* *NEW*: Complicated rule for recognition of @foo=@ style method names.
205 1 Kornelius Kalnbach
* *NEW*: Handles @:keep_state@ option (a bit; experimental).
206 1 Kornelius Kalnbach
  
207 1 Kornelius Kalnbach
  Actually, Ruby checks if there is @[~>=]@, but not @=>@ following the name.
208 1 Kornelius Kalnbach
209 1 Kornelius Kalnbach
h3. @Scanners::Scheme@
210 1 Kornelius Kalnbach
 
211 1 Kornelius Kalnbach
* *CHANGED*: Does use @:operator@ instead of @:operator_fat@ now.
212 1 Kornelius Kalnbach
213 1 Kornelius Kalnbach
h3. @Scanners::SQL@
214 1 Kornelius Kalnbach
 
215 1 Kornelius Kalnbach
* *IMPROVED*: Extended list of keywords and functions (thanks to Joshua Galvez).
216 1 Kornelius Kalnbach
 
217 1 Kornelius Kalnbach
  See "#221":http://redmine.rubychan.de/issues/221.
218 1 Kornelius Kalnbach
* *FIXED*: Closes open string groups.
219 1 Kornelius Kalnbach
220 1 Kornelius Kalnbach
h3. @Scanners::YAML@
221 1 Kornelius Kalnbach
 
222 1 Kornelius Kalnbach
* *FIXED*: Allow spaces before colon in mappings.
223 1 Kornelius Kalnbach
 
224 1 Kornelius Kalnbach
  See "#231":http://redmine.rubychan.de/issues/231.
225 1 Kornelius Kalnbach
226 1 Kornelius Kalnbach
h3. *NEW*: @Styles::Alpha@
227 1 Kornelius Kalnbach
 
228 1 Kornelius Kalnbach
A style that uses transparent HSLA colors as defined in CSS 3.
229 1 Kornelius Kalnbach
See "#199":http://redmine.rubychan.de/issues/199.
230 1 Kornelius Kalnbach
231 1 Kornelius Kalnbach
h3. @FileType@
232 1 Kornelius Kalnbach
 
233 1 Kornelius Kalnbach
* *REMOVED* @FileType#shebang@ is a protected method now.
234 1 Kornelius Kalnbach
* *NEW*: Recognizes @.gemspec@, @.rjs@, @.rpdf@ extensions and @Capfile@ as Ruby.
235 1 Kornelius Kalnbach
  
236 1 Kornelius Kalnbach
  Thanks to the authors of the TextMate Ruby bundle!
237 1 Kornelius Kalnbach
238 1 Kornelius Kalnbach
h3. @Plugin@
239 1 Kornelius Kalnbach
 
240 1 Kornelius Kalnbach
* *IMPROVED*: @register_for@ sets the @plugin_id@; it can now be a @Symbol@.
241 1 Kornelius Kalnbach
242 1 Kornelius Kalnbach
h3. Internal API changes
243 1 Kornelius Kalnbach
 
244 1 Kornelius Kalnbach
* *FIXED* @Encoders::HTML#token@'s second parameter is no longer optional.
245 1 Kornelius Kalnbach
246 1 Kornelius Kalnbach
247 1 Kornelius Kalnbach
h2. Changes in 0.9.3
248 1 Kornelius Kalnbach
 
249 1 Kornelius Kalnbach
* *FIXED*: Documentation of Tokens.
250 1 Kornelius Kalnbach
  ("#218":http://redmine.rubychan.de/issues/218)
251 1 Kornelius Kalnbach
 
252 1 Kornelius Kalnbach
h3. @coderay@ executable
253 1 Kornelius Kalnbach
 
254 1 Kornelius Kalnbach
* *NEW*: automatic TTY detection (uses @Term@ encoder)
255 1 Kornelius Kalnbach
* *NEW*: optional 3rd parameter for the filename
256 1 Kornelius Kalnbach
* *FIXED*: Converted to UNIX format.
257 1 Kornelius Kalnbach
* *FIXED*: Warn about generated files.
258 1 Kornelius Kalnbach
* *FIXED*: Ensure line break after the output (especially for LoC counter).
259 1 Kornelius Kalnbach
260 1 Kornelius Kalnbach
h3. @Scanners::JavaScript@
261 1 Kornelius Kalnbach
 
262 1 Kornelius Kalnbach
* *FIXED*: Don't keep state of XML scanner between calls for E4X literals.
263 1 Kornelius Kalnbach
264 1 Kornelius Kalnbach
h3. @Scanners::Java@, @Scanners::JSON@
265 1 Kornelius Kalnbach
 
266 1 Kornelius Kalnbach
* *FIXED*: Close unfinished strings with the correct token kind.
267 1 Kornelius Kalnbach
268 1 Kornelius Kalnbach
269 1 Kornelius Kalnbach
h2. Changes in 0.9.2
270 1 Kornelius Kalnbach
 
271 1 Kornelius Kalnbach
* *NEW* Basic tests and a _Rakefile_ are now included in the Gem. [Flameeyes]
272 1 Kornelius Kalnbach
  A @doc@ task is also included.
273 1 Kornelius Kalnbach
* *FIXED* Use @$CODERAY_DEBUG@ for debugging instead of @$DEBUG@. [Trans]
274 1 Kornelius Kalnbach
  ("#192":http://redmine.rubychan.de/issues/192)
275 1 Kornelius Kalnbach
* *REMOVED* @Term::Ansicolor@ was bundled under _lib/_, but not used. [Flameeyes]
276 1 Kornelius Kalnbach
  ("#205":http://redmine.rubychan.de/issues/205)
277 1 Kornelius Kalnbach
* *WORKAROUND* for Ruby bug 
278 1 Kornelius Kalnbach
  "#2745":http://redmine.ruby-lang.org/issues/show/2745
279 1 Kornelius Kalnbach
 
280 1 Kornelius Kalnbach
h3. @Encoders::Term@
281 1 Kornelius Kalnbach
 
282 1 Kornelius Kalnbach
* *FIXED* strings are closed correctly
283 1 Kornelius Kalnbach
  ("#138":http://redmine.rubychan.de/issues/138)
284 1 Kornelius Kalnbach
* *FIXED* several token kinds had no associated color
285 1 Kornelius Kalnbach
  ("#139":http://redmine.rubychan.de/issues/139)
286 1 Kornelius Kalnbach
* *NEW* alias @terminal@
287 1 Kornelius Kalnbach
  
288 1 Kornelius Kalnbach
  *NOTE:* This encoder will be renamed to @Encoders::Terminal@ in the next release.
289 1 Kornelius Kalnbach
290 1 Kornelius Kalnbach
h3. @Scanners::Debug@
291 1 Kornelius Kalnbach
 
292 1 Kornelius Kalnbach
* *FIXED* Don't close tokens that are not open. Send @:error@ token instead.
293 1 Kornelius Kalnbach
294 1 Kornelius Kalnbach
h3. @Scanners::Groovy@
295 1 Kornelius Kalnbach
 
296 1 Kornelius Kalnbach
* *FIXED* token kind of closing brackets is @:operator@ instead of @nil@
297 1 Kornelius Kalnbach
  ("#148":http://redmine.rubychan.de/issues/148)
298 1 Kornelius Kalnbach
299 1 Kornelius Kalnbach
h3. @Scanners::PHP@
300 1 Kornelius Kalnbach
 
301 1 Kornelius Kalnbach
* *FIXED* allow @\@ operator (namespace separator)
302 1 Kornelius Kalnbach
  ("#209":http://redmine.rubychan.de/issues/209)
303 1 Kornelius Kalnbach
304 1 Kornelius Kalnbach
h3. @Scanners::YAML@
305 1 Kornelius Kalnbach
 
306 1 Kornelius Kalnbach
* *FIXED* doesn't send debug tokens when @$DEBUG@ is true [Trans]
307 1 Kornelius Kalnbach
  ("#149":http://redmine.rubychan.de/issues/149)
308 1 Kornelius Kalnbach
309 1 Kornelius Kalnbach
310 1 Kornelius Kalnbach
h2. Changes in 0.9.1
311 1 Kornelius Kalnbach
 
312 1 Kornelius Kalnbach
h3. Token classes
313 1 Kornelius Kalnbach
 
314 1 Kornelius Kalnbach
* *NEW* token classes @:complex@, @:decorator@, @:imaginary@
315 1 Kornelius Kalnbach
  (all for Python)
316 1 Kornelius Kalnbach
* *REMOVED* token class @:procedure@
317 1 Kornelius Kalnbach
  – use @:function@ or @:method@ instead.
318 1 Kornelius Kalnbach
319 1 Kornelius Kalnbach
h3. @Tokens@
320 1 Kornelius Kalnbach
 
321 1 Kornelius Kalnbach
* *NEW* method @#scanner@
322 1 Kornelius Kalnbach
  
323 1 Kornelius Kalnbach
  Stores the scanner.
324 1 Kornelius Kalnbach
* *REMOVED* methods @.write_token@, @.read_token@, @.escape@, @.unescape@
325 1 Kornelius Kalnbach
  
326 1 Kornelius Kalnbach
  They were only used by the @Tokens@ encoder, which was removed also.
327 1 Kornelius Kalnbach
328 1 Kornelius Kalnbach
h3. @Encoders::Encoder@
329 1 Kornelius Kalnbach
 
330 1 Kornelius Kalnbach
* *REMOVED* Don't require the _stringio_ library.
331 1 Kornelius Kalnbach
* *NEW* public methods @#open_token@, @#close_token@, @#begin_line@, @#end_line@
332 1 Kornelius Kalnbach
  These methods are called automatically, like @#text_token@.
333 1 Kornelius Kalnbach
* *NEW* proteced method @#append_encoded_token_to_output@
334 1 Kornelius Kalnbach
335 1 Kornelius Kalnbach
h3. @Encoders::Tokens@
336 1 Kornelius Kalnbach
 
337 1 Kornelius Kalnbach
* *REMOVED* – use @Tokens#dump@ and @Tokens.load@.
338 1 Kornelius Kalnbach
339 1 Kornelius Kalnbach
h3. @Encoders::Filter@
340 1 Kornelius Kalnbach
 
341 1 Kornelius Kalnbach
* *NEW*
342 1 Kornelius Kalnbach
  A @Filter@ encoder has another @Tokens@ instance as output.
343 1 Kornelius Kalnbach
344 1 Kornelius Kalnbach
h3. @Encoders::TokenClassFilter@
345 1 Kornelius Kalnbach
 
346 1 Kornelius Kalnbach
* *NEW*
347 1 Kornelius Kalnbach
  
348 1 Kornelius Kalnbach
  It takes 2 options, @:exclude@ and @:include@, that specify which token classes
349 1 Kornelius Kalnbach
  to include or exclude for the output. They can be a single token class,
350 1 Kornelius Kalnbach
  an @Array@ of classes, or the value @:all@.
351 1 Kornelius Kalnbach
352 1 Kornelius Kalnbach
h3. @Encoders::CommentFilter@
353 1 Kornelius Kalnbach
 
354 1 Kornelius Kalnbach
* *NEW*
355 1 Kornelius Kalnbach
  
356 1 Kornelius Kalnbach
  Removes tokens of the @:comment@ class.
357 1 Kornelius Kalnbach
358 1 Kornelius Kalnbach
h3. @Encoders::LinesOfCode@
359 1 Kornelius Kalnbach
 
360 1 Kornelius Kalnbach
* *NEW*
361 1 Kornelius Kalnbach
  
362 1 Kornelius Kalnbach
  Counts the lines of code according to the @KINDS_NOT_LOC@ token class list
363 1 Kornelius Kalnbach
  defined by the scanner. It uses the new @TokenClassFilter@.
364 1 Kornelius Kalnbach
  
365 1 Kornelius Kalnbach
  Alias: @:loc@, as in @tokens.loc@.
366 1 Kornelius Kalnbach
367 1 Kornelius Kalnbach
h3. @Encoders::JSON@
368 1 Kornelius Kalnbach
 
369 1 Kornelius Kalnbach
* *NEW*
370 1 Kornelius Kalnbach
  
371 1 Kornelius Kalnbach
  Outputs tokens in a simple JSON format.
372 1 Kornelius Kalnbach
373 1 Kornelius Kalnbach
h3. @Encoders::Term@
374 1 Kornelius Kalnbach
 
375 1 Kornelius Kalnbach
* *NEW* (beta, by Rob Aldred)
376 1 Kornelius Kalnbach
  
377 1 Kornelius Kalnbach
  Outputs code highlighted for a color terminal.
378 1 Kornelius Kalnbach
379 1 Kornelius Kalnbach
h3. @Encoders::HTML@
380 1 Kornelius Kalnbach
 
381 1 Kornelius Kalnbach
* *NEW* option @:title@ (default value is _CodeRay output_)
382 1 Kornelius Kalnbach
  
383 1 Kornelius Kalnbach
  Setting this changes the title of the HTML page.
384 1 Kornelius Kalnbach
* *NEW* option @:highlight_lines@ (default: @nil@)
385 1 Kornelius Kalnbach
  
386 1 Kornelius Kalnbach
  Highlights the given set of line numbers.
387 1 Kornelius Kalnbach
- *REMOVED* option @:level@
388 1 Kornelius Kalnbach
  
389 1 Kornelius Kalnbach
  It didn't do anything. CodeRay always outputs XHTML.
390 1 Kornelius Kalnbach
391 1 Kornelius Kalnbach
h3. @Encoders::Text@
392 1 Kornelius Kalnbach
 
393 1 Kornelius Kalnbach
* Uses @Encoder@ interface with @super@ and @#text_token@.
394 1 Kornelius Kalnbach
395 1 Kornelius Kalnbach
h3. @Encoders::XML@
396 1 Kornelius Kalnbach
 
397 1 Kornelius Kalnbach
* @FIXED@ ("#94":http://redmine.rubychan.de/issues/94)
398 1 Kornelius Kalnbach
  
399 1 Kornelius Kalnbach
  It didn't work at all.
400 1 Kornelius Kalnbach
401 1 Kornelius Kalnbach
h3. Scanners
402 1 Kornelius Kalnbach
 
403 1 Kornelius Kalnbach
* *NEW* Mapped @:h@ to @:c@, @:cplusplus@ and @:'c++'@ to @:cpp@,
404 1 Kornelius Kalnbach
  @:ecma@, @:ecmascript@, @:ecma_script@ to @:java_script@,
405 1 Kornelius Kalnbach
  @:pascal@ to @:delphi@, and @:plain@ to @:plaintext@.
406 1 Kornelius Kalnbach
407 1 Kornelius Kalnbach
h3. @Scanners::Scanner@
408 1 Kornelius Kalnbach
 
409 1 Kornelius Kalnbach
* *NEW* constant @KINDS_NOT_LOC@
410 1 Kornelius Kalnbach
  
411 1 Kornelius Kalnbach
  A list of all token classes not considered in LOC count.
412 1 Kornelius Kalnbach
  Added appropriate values for scanners.
413 1 Kornelius Kalnbach
* *NEW* method @#lang@ returns the scanner's lang, which is its @plugin_id@.
414 1 Kornelius Kalnbach
* *FIXED* automatic, safe UTF-8 detection _[Ruby 1.9]_
415 1 Kornelius Kalnbach
* *FIXED* column takes care of multibyte encodings _[Ruby 1.9]_
416 1 Kornelius Kalnbach
* *FIXED* is dumpable (@Tokens@ store their scanner in an @@scanner@ variable)
417 1 Kornelius Kalnbach
418 1 Kornelius Kalnbach
h3. @Scanners::Cpp@
419 1 Kornelius Kalnbach
 
420 1 Kornelius Kalnbach
* *NEW* (C++)
421 1 Kornelius Kalnbach
422 1 Kornelius Kalnbach
h3. @Scanners::Groovy@
423 1 Kornelius Kalnbach
 
424 1 Kornelius Kalnbach
* *NEW* (beta)
425 1 Kornelius Kalnbach
426 1 Kornelius Kalnbach
h3. @Scanners::Python@
427 1 Kornelius Kalnbach
 
428 1 Kornelius Kalnbach
* *NEW*
429 1 Kornelius Kalnbach
430 1 Kornelius Kalnbach
h3. @Scanners::PHP@
431 1 Kornelius Kalnbach
 
432 1 Kornelius Kalnbach
* *NEW* (based on Stefan Walk's work)
433 1 Kornelius Kalnbach
434 1 Kornelius Kalnbach
h3. @Scanners::SQL@
435 1 Kornelius Kalnbach
 
436 1 Kornelius Kalnbach
* *NEW* (based on code by Josh Goebel)
437 1 Kornelius Kalnbach
438 1 Kornelius Kalnbach
h3. @Scanners::C@
439 1 Kornelius Kalnbach
 
440 1 Kornelius Kalnbach
* *IMPROVED* added a list of @:directive@ tokens that were @:reserved@ before
441 1 Kornelius Kalnbach
* *IMPROVED* detection of labels
442 1 Kornelius Kalnbach
* *IMPROVED* allow @1L@ and @1LL@ style literals
443 1 Kornelius Kalnbach
444 1 Kornelius Kalnbach
h3. @Scanners::CSS@
445 1 Kornelius Kalnbach
 
446 1 Kornelius Kalnbach
* *IMPROVED* element selectors are highlighted as @:type@ instead of @:keyword@
447 1 Kornelius Kalnbach
448 1 Kornelius Kalnbach
h3. @Scanners::Delphi@
449 1 Kornelius Kalnbach
 
450 1 Kornelius Kalnbach
* *IMPROVED* Don't cache tokens in CaseIgnoringWordList.
451 1 Kornelius Kalnbach
452 1 Kornelius Kalnbach
h3. @Scanners::Java@
453 1 Kornelius Kalnbach
 
454 1 Kornelius Kalnbach
* *IMPROVED* @assert@ is highlighted as a @:keyword@ now
455 1 Kornelius Kalnbach
* *IMPROVED* @const@ and @goto@ are highlighted as @:reserved@
456 1 Kornelius Kalnbach
* *IMPROVED* @false@, @true@, and @null@ are highlighted as @:pre_constant@
457 1 Kornelius Kalnbach
* *IMPROVED* @threadsafe@ is no longer a @:directive@
458 1 Kornelius Kalnbach
* *IMPROVED* @String@ is highlighted as a @:pre_type@
459 1 Kornelius Kalnbach
* *IMPROVED* built-in classes ending with _Error_ or _Exception_ are
460 1 Kornelius Kalnbach
  highlighted as a @:exception@ instead of @:pre_type@
461 1 Kornelius Kalnbach
462 1 Kornelius Kalnbach
h3. @Scanners::JavaScript@
463 1 Kornelius Kalnbach
 
464 1 Kornelius Kalnbach
* *NEW* a list of @PREDEFINED_CONSTANTS@ to be highlighted as @:pre_constant@
465 1 Kornelius Kalnbach
* *NEW* XML literals are recognized and highlighted
466 1 Kornelius Kalnbach
* *NEW* function name highlighting
467 1 Kornelius Kalnbach
* *IMPROVED* @.1@ is highlighted a number
468 1 Kornelius Kalnbach
* *FIXED* strings close with the correct kind when terminated unexpectedly
469 1 Kornelius Kalnbach
470 1 Kornelius Kalnbach
h3. @Scanners::JSON@
471 1 Kornelius Kalnbach
 
472 1 Kornelius Kalnbach
* *IMPROVED* constants (@true@, @false@, @nil@) are highlighted as @:value@
473 1 Kornelius Kalnbach
474 1 Kornelius Kalnbach
h3. @Scanners::Ruby@
475 1 Kornelius Kalnbach
 
476 1 Kornelius Kalnbach
* *IMPROVED* @Patterns::KEYWORDS_EXPECTING_VALUE@ for more accurate
477 1 Kornelius Kalnbach
  @value_expected@ detection
478 1 Kornelius Kalnbach
* *IMPROVED* handling of @\@ as a string delimiter
479 1 Kornelius Kalnbach
* *IMPROVED* handling of unicode strings; automatic switching to unicode
480 1 Kornelius Kalnbach
* *IMPROVED* highlighting of @self.method@ definitions
481 1 Kornelius Kalnbach
* *REMOVED* @Patterns::FANCY_START_SAVE@ (obsolete)
482 1 Kornelius Kalnbach
* *FIXED* encoding issues _[Ruby 1.9]_
483 1 Kornelius Kalnbach
* *FIXED* a problem in early Ruby 1.8.6 patch versions with @Regexp.escape@
484 1 Kornelius Kalnbach
485 1 Kornelius Kalnbach
h3. @Scanners::YAML@
486 1 Kornelius Kalnbach
 
487 1 Kornelius Kalnbach
* *IMPROVED* indentation detection
488 1 Kornelius Kalnbach
489 1 Kornelius Kalnbach
h3. @Styles::Cycnus@
490 1 Kornelius Kalnbach
 
491 1 Kornelius Kalnbach
* changed a few colors (exceptions, inline strings, predefined types)
492 1 Kornelius Kalnbach
493 1 Kornelius Kalnbach
h3. @Plugin@
494 1 Kornelius Kalnbach
 
495 1 Kornelius Kalnbach
* *NEW* method @#title@
496 1 Kornelius Kalnbach
  
497 1 Kornelius Kalnbach
  Set and get the plugin's title. Titles can be arbitrary strings.
498 1 Kornelius Kalnbach
* *NEW* method @#helper@ loads helpers from different plugins
499 1 Kornelius Kalnbach
  
500 1 Kornelius Kalnbach
  Use this syntax: @helper 'other_plugin/helper_name'@
501 1 Kornelius Kalnbach
502 1 Kornelius Kalnbach
h3. @FileType@
503 1 Kornelius Kalnbach
 
504 1 Kornelius Kalnbach
* *NEW* @FileType[]@ takes @Pathname@ instances
505 1 Kornelius Kalnbach
* *NEW* regonizes @.cc@, @.cpp@, @.cp@, @.cxx@, @.c++@, @.C@, @.hh@, @.hpp@, @.h++@, @.cu@ extensions (C++)
506 1 Kornelius Kalnbach
  
507 1 Kornelius Kalnbach
  Thanks to Sander Cox and the TextMate C bundle.
508 1 Kornelius Kalnbach
* *NEW* regonizes @.pas@, @.dpr@ extensions (Delphi)
509 1 Kornelius Kalnbach
* *NEW* regonizes @.gvy@, @.groovy@ extensions (Groovy)
510 1 Kornelius Kalnbach
* *NEW* regonizes @.php@, @.php3@, @.php4@, @.php5@ extensions (PHP)
511 1 Kornelius Kalnbach
* *NEW* regonizes @.py@, @.py3@, @.pyw@ extensions (Python)
512 1 Kornelius Kalnbach
* *NEW* regonizes @.rxml@ extension (Ruby)
513 1 Kornelius Kalnbach
* *NEW* regonizes @.sql@ extension (SQL)
514 1 Kornelius Kalnbach
* File types list was sorted alphabetically.
515 1 Kornelius Kalnbach
516 1 Kornelius Kalnbach
h3. @CaseIgnoringWordList@
517 1 Kornelius Kalnbach
 
518 1 Kornelius Kalnbach
* *FIXED* ("#97":http://redmine.rubychan.de/issues/97)
519 1 Kornelius Kalnbach
  
520 1 Kornelius Kalnbach
  The default value is no longer ignored.
521 1 Kornelius Kalnbach
522 1 Kornelius Kalnbach
h3. @ForRedCloth@
523 1 Kornelius Kalnbach
 
524 1 Kornelius Kalnbach
* *FIXED* for RedCloth versions 4.2.0+ ("#119":http://redmine.rubychan.de/issues/119)
525 1 Kornelius Kalnbach
526 1 Kornelius Kalnbach
h3. Cleanups
527 1 Kornelius Kalnbach
 
528 1 Kornelius Kalnbach
* warnings about character classes _[Ruby 1.9]_
529 1 Kornelius Kalnbach
* encoding issues _[Ruby 1.9]_
530 1 Kornelius Kalnbach
* documentation, code