coderay 0.9.5 → 0.9.6.pre

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 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.9.5
21
+ Version: 0.9.6
22
22
  Author:: murphy (Kornelius Kalnbach)
23
23
  Contact:: murphy rubychan de
24
24
  Website:: coderay.rubychan.de[http://coderay.rubychan.de]
@@ -134,7 +134,7 @@ module CodeRay
134
134
  # Minor: feature milestone
135
135
  # Teeny: development state, 0 for pre-release
136
136
  # Revision: Subversion Revision number (generated on rake gem:make)
137
- VERSION = '0.9.5'
137
+ VERSION = '0.9.6'
138
138
 
139
139
  require 'coderay/tokens'
140
140
  require 'coderay/token_classes'
@@ -181,17 +181,20 @@ module Scanners
181
181
  if last_token_dot
182
182
  kind = if match[/^[A-Z]/] and not match?(/\(/) then :constant else :ident end
183
183
  else
184
- kind = patterns::IDENT_KIND[match]
185
- if kind == :ident
186
- if match[/^[A-Z]/] and not match[/[!?]$/] and not match?(/\(/)
187
- kind = :constant
188
- elsif scan(/:(?= )/)
189
- match << ':'
190
- kind = :symbol
184
+ if value_expected != :expect_colon && scan(/:(?= )/)
185
+ tokens << [match, :key]
186
+ match = ':'
187
+ kind = :operator
188
+ else
189
+ kind = patterns::IDENT_KIND[match]
190
+ if kind == :ident
191
+ if match[/\A[A-Z]/] and not match[/[!?]$/] and not match?(/\(/)
192
+ kind = :constant
193
+ end
194
+ elsif kind == :reserved
195
+ state = patterns::DEF_NEW_STATE[match]
196
+ value_expected = :set if patterns::KEYWORDS_EXPECTING_VALUE[match]
191
197
  end
192
- elsif kind == :reserved
193
- state = patterns::DEF_NEW_STATE[match]
194
- value_expected = :set if patterns::KEYWORDS_EXPECTING_VALUE[match]
195
198
  end
196
199
  end
197
200
  value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o)
@@ -401,7 +404,9 @@ module Scanners
401
404
  # }}}
402
405
 
403
406
  unless kind == :error
404
- value_expected = value_expected == :set
407
+ if value_expected = value_expected == :set
408
+ value_expected = :expect_colon if match == '?' || match == 'when'
409
+ end
405
410
  last_token_dot = last_token_dot == :set
406
411
  end
407
412
 
@@ -16,7 +16,7 @@ module Scanners
16
16
  DEF_KEYWORDS = %w[ def ]
17
17
  UNDEF_KEYWORDS = %w[ undef ]
18
18
  ALIAS_KEYWORDS = %w[ alias ]
19
- MODULE_KEYWORDS = %w[class module]
19
+ MODULE_KEYWORDS = %w[ class module ]
20
20
  DEF_NEW_STATE = WordList.new(:initial).
21
21
  add(DEF_KEYWORDS, :def_expected).
22
22
  add(UNDEF_KEYWORDS, :undef_expected).
@@ -25,7 +25,8 @@ module Scanners
25
25
 
26
26
  PREDEFINED_CONSTANTS = %w[
27
27
  nil true false self
28
- DATA ARGV ARGF __FILE__ __LINE__
28
+ DATA ARGV ARGF
29
+ __FILE__ __LINE__ __ENCODING__
29
30
  ]
30
31
 
31
32
  IDENT_KIND = WordList.new(:ident).
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
5
- prerelease: false
4
+ prerelease: true
6
5
  segments:
7
6
  - 0
8
7
  - 9
9
- - 5
10
- version: 0.9.5
8
+ - 6
9
+ - pre
10
+ version: 0.9.6.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - murphy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-28 00:00:00 +02:00
18
+ date: 2010-10-11 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -122,7 +122,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
- hash: 51
126
125
  segments:
127
126
  - 1
128
127
  - 8
@@ -131,12 +130,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
130
  required_rubygems_version: !ruby/object:Gem::Requirement
132
131
  none: false
133
132
  requirements:
134
- - - ">="
133
+ - - ">"
135
134
  - !ruby/object:Gem::Version
136
- hash: 3
137
135
  segments:
138
- - 0
139
- version: "0"
136
+ - 1
137
+ - 3
138
+ - 1
139
+ version: 1.3.1
140
140
  requirements: []
141
141
 
142
142
  rubyforge_project: coderay