| 1 |
h1=. CodeRay Version History |
| 2 |
|
| 3 |
p=. _This files lists all changes in the CodeRay library since the 0.8.4 release._ |
| 4 |
|
| 5 |
{{toc}} |
| 6 |
|
| 7 |
h2. Changes in 0.9.8 "banister" [2011-05-01] |
| 8 |
|
| 9 |
Fixes for JRuby's 1.9 mode and minor issues. |
| 10 |
|
| 11 |
h3. Rake tasks |
| 12 |
|
| 13 |
* *REMOVED* obsolete @has_rdoc@ gem specification, fixing a warning. |
| 14 |
|
| 15 |
h3. @Scanners::Scanner@ |
| 16 |
|
| 17 |
* *NEW* method @#scan_rest@ replaces @scan_until(/\z/)@, which is broken in JRuby 1.6 --1.9 mode. |
| 18 |
See "#297":http://odd-eyed-code.org/issues/297. |
| 19 |
|
| 20 |
h3. @Scanners::CSS@ |
| 21 |
|
| 22 |
* *FIXED* LOC counting (should be 0). |
| 23 |
See "#296":http://odd-eyed-code.org/issues/296. |
| 24 |
|
| 25 |
h3. @Scanners::Ruby@ |
| 26 |
|
| 27 |
* *FIXED* the @IDENT@ pattern not to use character properties, which are broken in JRuby 1.6 --1.9 mode. |
| 28 |
See "#297":http://odd-eyed-code.org/issues/297, thanks to banister for reporting! |
| 29 |
|
| 30 |
h3. @Scanners::SQL@ |
| 31 |
|
| 32 |
* *ADDED* more keywords: @between@, @databases@, @distinct@, @fields@, @full@, @having@, @is@, @prompt@, @tables@. |
| 33 |
See "#221":http://odd-eyed-code.org/issues/221, thanks to Etienne Massip again. |
| 34 |
|
| 35 |
h3. @FileType@ |
| 36 |
|
| 37 |
* *NEW* regonizes ColdFusion file type extensions @.cfm@ and @.cfc@ as XML. |
| 38 |
See "#298":http://odd-eyed-code.org/issues/298, thanks to Emidio Stani. |
| 39 |
|
| 40 |
|
| 41 |
h2. Changes in 0.9.7 "Etienne" [2011-01-14] |
| 42 |
|
| 43 |
Fixes a dangerous JavaScript scanner bug, and a testing problem with Ruby 1.9.1. |
| 44 |
|
| 45 |
h3. Tests |
| 46 |
|
| 47 |
* *FIXED* The functional tests now load the lib directory (instead of the gem) in Ruby 1.9.1. |
| 48 |
|
| 49 |
h3. @Scanners::JavaScript@ |
| 50 |
|
| 51 |
* *FIXED* @KEY_CHECK_PATTERN@ regexp |
| 52 |
See "#264":http://odd-eyed-code.org/issues/264, thanks to Etienne Massip! |
| 53 |
|
| 54 |
|
| 55 |
h2. Changes in 0.9.6 "WoNáDo" [2010-11-25] |
| 56 |
|
| 57 |
Minor improvements to the Ruby scanner and a fix for Ruby 1.9. |
| 58 |
|
| 59 |
h3. @Scanners::Ruby@ |
| 60 |
|
| 61 |
* *IMPROVED* handling of new hash syntax (keys are marked as @:key@ now, |
| 62 |
colon is a separate @:operator@ token, all idents can be used as keys) |
| 63 |
See "#257":http://code.licenser.net/issues/257, thanks to WoNáDo! |
| 64 |
* *ADDED* @__ENCODING__@ magic constant (Ruby 1.9) |
| 65 |
* *FIXED*: Scanner no longer tries to modify the input string on Ruby 1.9. |
| 66 |
See "#260":http://code.licenser.net/issues/260, thanks to Jan Lelis! |
| 67 |
|
| 68 |
|
| 69 |
h2. Changes in 0.9.5 "Germany.rb" [2010-09-28] |
| 70 |
|
| 71 |
Support for Rubinius ("#251":http://odd-eyed-code.org/issues/251), improved mutlibyte handling, Ruby 1.9 syntax, and valid HTML. |
| 72 |
|
| 73 |
h3. @Encoders::HTML@ |
| 74 |
|
| 75 |
* *FIXED*: Line tokens use @span@ with @display: block@ instead of @div@, which was invalid HTML ("#255":http://odd-eyed-code.org/issues/255). |
| 76 |
|
| 77 |
h3. @Scanner::Scanner@ |
| 78 |
|
| 79 |
* *IMPROVED* handling of encodings in Ruby 1.9: UTF-8 and Windows-1252 are checked. |
| 80 |
* *NEW*: Invalid chars will be converted to @?@ in Ruby 1.9. |
| 81 |
* *FIXED* @string=@ method for Rubinius. See "issue 481":http://github.com/evanphx/rubinius/issues/481 on their site. |
| 82 |
|
| 83 |
h3. @Scanners::CSS@ |
| 84 |
|
| 85 |
* *FIXED*: Don't use non-ASCII regexps. |
| 86 |
|
| 87 |
h3. @Scanners::Diff@ |
| 88 |
|
| 89 |
* *FIXED*: Highlight unexpected lines as @:comment@. |
| 90 |
|
| 91 |
h3. @Scanners::PHP@ |
| 92 |
|
| 93 |
* *FIXED*: Use @ASCII-8BIT@ encoding for now. |
| 94 |
|
| 95 |
h3. @Scanners::Ruby@ |
| 96 |
|
| 97 |
* *ADDED* support for some Ruby 1.9 syntax ("#254":http://odd-eyed-code.org/issues/254): |
| 98 |
** the @->@ lambda shortcut |
| 99 |
** new Hash syntax using colons (@{ a: b }@) |
| 100 |
* *FIXED*: Use @UTF-8@ encoding. |
| 101 |
* *IMPROVED* unicode support on Ruby 1.8 ("#253":http://odd-eyed-code.org/issues/253). |
| 102 |
* *FIXED* recognition of non-ASCII identifiers in Ruby 1.9, JRuby, and Rubinius ("#253":http://odd-eyed-code.org/issues/253). |
| 103 |
* *CHANGED* heredoc recognition to ignore delimiters starting with a digit. This is incorrect, but causes less false positives. |
| 104 |
|
| 105 |
h3. @Scanners::SQL@ |
| 106 |
|
| 107 |
* *FIXED* scanning of comments; nice catch, Rubinius! |
| 108 |
("#252":http://odd-eyed-code.org/issues/252) |
| 109 |
|
| 110 |
|
| 111 |
h2. Changes in 0.9.4 "Ramadan" [2010-08-31] |
| 112 |
|
| 113 |
Updated command line interface and minor scanner fixes for the Diff, HTML, and RHTML scanners. |
| 114 |
|
| 115 |
h3. @coderay@ executable |
| 116 |
|
| 117 |
* *FIXED*: Partly rewritten, simplified, fixed. |
| 118 |
("#244":http://odd-eyed-code.org/issues/244) |
| 119 |
|
| 120 |
h3. @Scanners::Diff@ |
| 121 |
|
| 122 |
* *FIXED* handling of change headers with code on the same line as the @@ marker. |
| 123 |
("#247":http://odd-eyed-code.org/issues/242) |
| 124 |
|
| 125 |
h3. @Scanners::HTML@ |
| 126 |
|
| 127 |
* *FIXED* a missing regexp modifier that slowed down the scanning. |
| 128 |
("#245":http://odd-eyed-code.org/issues/245) |
| 129 |
|
| 130 |
h3. @Scanners::RHTML@ |
| 131 |
|
| 132 |
* *FIXED* highlighting of ERB comment blocks. |
| 133 |
("#246":http://odd-eyed-code.org/issues/246) |
| 134 |
|
| 135 |
|
| 136 |
h2. Changes in 0.9.3 "Eyjafjallajökull" [2010-04-18] |
| 137 |
|
| 138 |
* *FIXED*: Documentation of Tokens. |
| 139 |
("#218":http://odd-eyed-code.org/issues/218) |
| 140 |
|
| 141 |
h3. @coderay@ executable |
| 142 |
|
| 143 |
* *NEW*: automatic TTY detection (uses @Term@ encoder) |
| 144 |
* *NEW*: optional 3rd parameter for the filename |
| 145 |
* *FIXED*: Converted to UNIX format. |
| 146 |
* *FIXED*: Warn about generated files. |
| 147 |
* *FIXED*: Ensure line break after the output (especially for LoC counter). |
| 148 |
|
| 149 |
h3. @Scanners::JavaScript@ |
| 150 |
|
| 151 |
* *FIXED*: Don't keep state of XML scanner between calls for E4X literals. |
| 152 |
|
| 153 |
h3. @Scanners::Java@, @Scanners::JSON@ |
| 154 |
|
| 155 |
* *FIXED*: Close unfinished strings with the correct token kind. |
| 156 |
|
| 157 |
|
| 158 |
h2. Changes in 0.9.2 "Flameeyes" [2010-03-14] |
| 159 |
|
| 160 |
* *NEW* Basic tests and a _Rakefile_ are now included in the Gem. [Flameeyes] |
| 161 |
A @doc@ task is also included. |
| 162 |
* *FIXED* Use @$CODERAY_DEBUG@ for debugging instead of @$DEBUG@. [Trans] |
| 163 |
("#192":http://odd-eyed-code.org/issues/192) |
| 164 |
* *REMOVED* @Term::Ansicolor@ was bundled under _lib/_, but not used. [Flameeyes] |
| 165 |
("#205":http://odd-eyed-code.org/issues/205) |
| 166 |
* *WORKAROUND* for Ruby bug |
| 167 |
"#2745":http://redmine.ruby-lang.org/issues/show/2745 |
| 168 |
|
| 169 |
h3. @Encoders::Term@ |
| 170 |
|
| 171 |
* *FIXED* strings are closed correctly |
| 172 |
("#138":http://odd-eyed-code.org/issues/138) |
| 173 |
* *FIXED* several token kinds had no associated color |
| 174 |
("#139":http://odd-eyed-code.org/issues/139) |
| 175 |
* *NEW* alias @terminal@ |
| 176 |
|
| 177 |
*NOTE:* This encoder will be renamed to @Encoders::Terminal@ in the next release. |
| 178 |
|
| 179 |
h3. @Scanners::Debug@ |
| 180 |
|
| 181 |
* *FIXED* Don't close tokens that are not open. Send @:error@ token instead. |
| 182 |
|
| 183 |
h3. @Scanners::Groovy@ |
| 184 |
|
| 185 |
* *FIXED* token kind of closing brackets is @:operator@ instead of @nil@ |
| 186 |
("#148":http://odd-eyed-code.org/issues/148) |
| 187 |
|
| 188 |
h3. @Scanners::PHP@ |
| 189 |
|
| 190 |
* *FIXED* allow @\@ operator (namespace separator) |
| 191 |
("#209":http://odd-eyed-code.org/issues/209) |
| 192 |
|
| 193 |
h3. @Scanners::YAML@ |
| 194 |
|
| 195 |
* *FIXED* doesn't send debug tokens when @$DEBUG@ is true [Trans] |
| 196 |
("#149":http://odd-eyed-code.org/issues/149) |
| 197 |
|
| 198 |
|
| 199 |
h2. Changes in 0.9.1 [2009-12-31] |
| 200 |
|
| 201 |
h3. Token classes |
| 202 |
|
| 203 |
* *NEW* token classes @:complex@, @:decorator@, @:imaginary@ |
| 204 |
(all for Python) |
| 205 |
* *REMOVED* token class @:procedure@ |
| 206 |
– use @:function@ or @:method@ instead. |
| 207 |
|
| 208 |
h3. @Tokens@ |
| 209 |
|
| 210 |
* *NEW* method @#scanner@ |
| 211 |
|
| 212 |
Stores the scanner. |
| 213 |
* *REMOVED* methods @.write_token@, @.read_token@, @.escape@, @.unescape@ |
| 214 |
|
| 215 |
They were only used by the @Tokens@ encoder, which was removed also. |
| 216 |
|
| 217 |
h3. @Encoders::Encoder@ |
| 218 |
|
| 219 |
* *REMOVED* Don't require the _stringio_ library. |
| 220 |
* *NEW* public methods @#open_token@, @#close_token@, @#begin_line@, @#end_line@ |
| 221 |
These methods are called automatically, like @#text_token@. |
| 222 |
* *NEW* proteced method @#append_encoded_token_to_output@ |
| 223 |
|
| 224 |
h3. @Encoders::Tokens@ |
| 225 |
|
| 226 |
* *REMOVED* – use @Tokens#dump@ and @Tokens.load@. |
| 227 |
|
| 228 |
h3. @Encoders::Filter@ |
| 229 |
|
| 230 |
* *NEW* |
| 231 |
A @Filter@ encoder has another @Tokens@ instance as output. |
| 232 |
|
| 233 |
h3. @Encoders::TokenClassFilter@ |
| 234 |
|
| 235 |
* *NEW* |
| 236 |
|
| 237 |
It takes 2 options, @:exclude@ and @:include@, that specify which token classes |
| 238 |
to include or exclude for the output. They can be a single token class, |
| 239 |
an @Array@ of classes, or the value @:all@. |
| 240 |
|
| 241 |
h3. @Encoders::CommentFilter@ |
| 242 |
|
| 243 |
* *NEW* |
| 244 |
|
| 245 |
Removes tokens of the @:comment@ class. |
| 246 |
|
| 247 |
h3. @Encoders::LinesOfCode@ |
| 248 |
|
| 249 |
* *NEW* |
| 250 |
|
| 251 |
Counts the lines of code according to the @KINDS_NOT_LOC@ token class list |
| 252 |
defined by the scanner. It uses the new @TokenClassFilter@. |
| 253 |
|
| 254 |
Alias: @:loc@, as in @tokens.loc@. |
| 255 |
|
| 256 |
h3. @Encoders::JSON@ |
| 257 |
|
| 258 |
* *NEW* |
| 259 |
|
| 260 |
Outputs tokens in a simple JSON format. |
| 261 |
|
| 262 |
h3. @Encoders::Term@ |
| 263 |
|
| 264 |
* *NEW* (beta, by Rob Aldred) |
| 265 |
|
| 266 |
Outputs code highlighted for a color terminal. |
| 267 |
|
| 268 |
h3. @Encoders::HTML@ |
| 269 |
|
| 270 |
* *NEW* option @:title@ (default value is _CodeRay output_) |
| 271 |
|
| 272 |
Setting this changes the title of the HTML page. |
| 273 |
* *NEW* option @:highlight_lines@ (default: @nil@) |
| 274 |
|
| 275 |
Highlights the given set of line numbers. |
| 276 |
- *REMOVED* option @:level@ |
| 277 |
|
| 278 |
It didn't do anything. CodeRay always outputs XHTML. |
| 279 |
|
| 280 |
h3. @Encoders::Text@ |
| 281 |
|
| 282 |
* Uses @Encoder@ interface with @super@ and @#text_token@. |
| 283 |
|
| 284 |
h3. @Encoders::XML@ |
| 285 |
|
| 286 |
* @FIXED@ ("#94":http://odd-eyed-code.org/issues/94) |
| 287 |
|
| 288 |
It didn't work at all. |
| 289 |
|
| 290 |
h3. Scanners |
| 291 |
|
| 292 |
* *NEW* Mapped @:h@ to @:c@, @:cplusplus@ and @:'c++'@ to @:cpp@, |
| 293 |
@:ecma@, @:ecmascript@, @:ecma_script@ to @:java_script@, |
| 294 |
@:pascal@ to @:delphi@, and @:plain@ to @:plaintext@. |
| 295 |
|
| 296 |
h3. @Scanners::Scanner@ |
| 297 |
|
| 298 |
* *NEW* constant @KINDS_NOT_LOC@ |
| 299 |
|
| 300 |
A list of all token classes not considered in LOC count. |
| 301 |
Added appropriate values for scanners. |
| 302 |
* *NEW* method @#lang@ returns the scanner's lang, which is its @plugin_id@. |
| 303 |
* *FIXED* automatic, safe UTF-8 detection _[Ruby 1.9]_ |
| 304 |
* *FIXED* column takes care of multibyte encodings _[Ruby 1.9]_ |
| 305 |
* *FIXED* is dumpable (@Tokens@ store their scanner in an @@scanner@ variable) |
| 306 |
|
| 307 |
h3. @Scanners::Cpp@ |
| 308 |
|
| 309 |
* *NEW* (C++) |
| 310 |
|
| 311 |
h3. @Scanners::Groovy@ |
| 312 |
|
| 313 |
* *NEW* (beta) |
| 314 |
|
| 315 |
h3. @Scanners::Python@ |
| 316 |
|
| 317 |
* *NEW* |
| 318 |
|
| 319 |
h3. @Scanners::PHP@ |
| 320 |
|
| 321 |
* *NEW* (based on Stefan Walk's work) |
| 322 |
|
| 323 |
h3. @Scanners::SQL@ |
| 324 |
|
| 325 |
* *NEW* (based on code by Josh Goebel) |
| 326 |
|
| 327 |
h3. @Scanners::C@ |
| 328 |
|
| 329 |
* *IMPROVED* added a list of @:directive@ tokens that were @:reserved@ before |
| 330 |
* *IMPROVED* detection of labels |
| 331 |
* *IMPROVED* allow @1L@ and @1LL@ style literals |
| 332 |
|
| 333 |
h3. @Scanners::CSS@ |
| 334 |
|
| 335 |
* *IMPROVED* element selectors are highlighted as @:type@ instead of @:keyword@ |
| 336 |
|
| 337 |
h3. @Scanners::Delphi@ |
| 338 |
|
| 339 |
* *IMPROVED* Don't cache tokens in CaseIgnoringWordList. |
| 340 |
|
| 341 |
h3. @Scanners::Java@ |
| 342 |
|
| 343 |
* *IMPROVED* @assert@ is highlighted as a @:keyword@ now |
| 344 |
* *IMPROVED* @const@ and @goto@ are highlighted as @:reserved@ |
| 345 |
* *IMPROVED* @false@, @true@, and @null@ are highlighted as @:pre_constant@ |
| 346 |
* *IMPROVED* @threadsafe@ is no longer a @:directive@ |
| 347 |
* *IMPROVED* @String@ is highlighted as a @:pre_type@ |
| 348 |
* *IMPROVED* built-in classes ending with _Error_ or _Exception_ are |
| 349 |
highlighted as a @:exception@ instead of @:pre_type@ |
| 350 |
|
| 351 |
h3. @Scanners::JavaScript@ |
| 352 |
|
| 353 |
* *NEW* a list of @PREDEFINED_CONSTANTS@ to be highlighted as @:pre_constant@ |
| 354 |
* *NEW* XML literals are recognized and highlighted |
| 355 |
* *NEW* function name highlighting |
| 356 |
* *IMPROVED* @.1@ is highlighted a number |
| 357 |
* *FIXED* strings close with the correct kind when terminated unexpectedly |
| 358 |
|
| 359 |
h3. @Scanners::JSON@ |
| 360 |
|
| 361 |
* *IMPROVED* constants (@true@, @false@, @nil@) are highlighted as @:value@ |
| 362 |
|
| 363 |
h3. @Scanners::Ruby@ |
| 364 |
|
| 365 |
* *IMPROVED* @Patterns::KEYWORDS_EXPECTING_VALUE@ for more accurate |
| 366 |
@value_expected@ detection |
| 367 |
* *IMPROVED* handling of @\@ as a string delimiter |
| 368 |
* *IMPROVED* handling of unicode strings; automatic switching to unicode |
| 369 |
* *IMPROVED* highlighting of @self.method@ definitions |
| 370 |
* *REMOVED* @Patterns::FANCY_START_SAVE@ (obsolete) |
| 371 |
* *FIXED* encoding issues _[Ruby 1.9]_ |
| 372 |
* *FIXED* a problem in early Ruby 1.8.6 patch versions with @Regexp.escape@ |
| 373 |
|
| 374 |
h3. @Scanners::YAML@ |
| 375 |
|
| 376 |
* *IMPROVED* indentation detection |
| 377 |
|
| 378 |
h3. @Styles::Cycnus@ |
| 379 |
|
| 380 |
* changed a few colors (exceptions, inline strings, predefined types) |
| 381 |
|
| 382 |
h3. @Plugin@ |
| 383 |
|
| 384 |
* *NEW* method @#title@ |
| 385 |
|
| 386 |
Set and get the plugin's title. Titles can be arbitrary strings. |
| 387 |
* *NEW* method @#helper@ loads helpers from different plugins |
| 388 |
|
| 389 |
Use this syntax: @helper 'other_plugin/helper_name'@ |
| 390 |
|
| 391 |
h3. @FileType@ |
| 392 |
|
| 393 |
* *NEW* @FileType[]@ takes @Pathname@ instances |
| 394 |
* *NEW* regonizes @.cc@, @.cpp@, @.cp@, @.cxx@, @.c++@, @.C@, @.hh@, @.hpp@, @.h++@, @.cu@ extensions (C++) |
| 395 |
|
| 396 |
Thanks to Sander Cox and the TextMate C bundle. |
| 397 |
* *NEW* regonizes @.pas@, @.dpr@ extensions (Delphi) |
| 398 |
* *NEW* regonizes @.gvy@, @.groovy@ extensions (Groovy) |
| 399 |
* *NEW* regonizes @.php@, @.php3@, @.php4@, @.php5@ extensions (PHP) |
| 400 |
* *NEW* regonizes @.py@, @.py3@, @.pyw@ extensions (Python) |
| 401 |
* *NEW* regonizes @.rxml@ extension (Ruby) |
| 402 |
* *NEW* regonizes @.sql@ extension (SQL) |
| 403 |
* File types list was sorted alphabetically. |
| 404 |
|
| 405 |
h3. @CaseIgnoringWordList@ |
| 406 |
|
| 407 |
* *FIXED* ("#97":http://odd-eyed-code.org/issues/97) |
| 408 |
|
| 409 |
The default value is no longer ignored. |
| 410 |
|
| 411 |
h3. @ForRedCloth@ |
| 412 |
|
| 413 |
* *FIXED* for RedCloth versions 4.2.0+ ("#119":http://odd-eyed-code.org/issues/119) |
| 414 |
|
| 415 |
h3. Cleanups |
| 416 |
|
| 417 |
* warnings about character classes _[Ruby 1.9]_ |
| 418 |
* encoding issues _[Ruby 1.9]_ |
| 419 |
* documentation, code |
| 420 |
|
| 421 |
|