rubylexer 0.7.4 → 0.7.5

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.
@@ -1,3 +1,7 @@
1
+ === 0.7.5/5-23-2009
2
+ * 1 Bugfix:
3
+ * fixed problem with parsing shebang lines
4
+
1
5
  === 0.7.4/5-20-2009
2
6
  * 2 Major Enhancements:
3
7
  * preliminary support for ruby 1.9
@@ -202,7 +202,7 @@ class RubyLexer
202
202
  if @file.skip( /\A#!/ )
203
203
  loop do
204
204
  til_charset( /[\s\v]/ )
205
- break if @file.skip( / ([^-\s\v]|--[\s\v])/,4 )
205
+ break if @file.match( / ([^-\s\v]|--[\s\v])/,4 )
206
206
  if @file.skip( /.-K(.)/ )
207
207
  case $1
208
208
  when 'u'; @encoding=:utf8
@@ -977,7 +977,6 @@ private
977
977
  loop do
978
978
  offset=input_position
979
979
  @file.scan(/\A(#@@WSTOKS)?(#@@UCLETTER#@@LETTER_DIGIT*)(::)?/o)
980
- #this regexp---^ will need to change in order to support utf8 properly.
981
980
  md=@file.last_match
982
981
  all,ws,name,dc=*md
983
982
  if ws
@@ -1020,13 +1019,14 @@ private
1020
1019
  @parsestack.push ExpectThenOrNlContext.new(str,@linenum)
1021
1020
  return result
1022
1021
  end
1022
+
1023
1023
  def keyword_begin(str,offset,result)
1024
1024
  result.first.has_end!
1025
1025
  @parsestack.push WantsEndContext.new(str,@linenum)
1026
1026
  return result
1027
1027
  end
1028
-
1029
1028
  alias keyword_case keyword_begin
1029
+
1030
1030
  def keyword_while(str,offset,result) #could be infix form without end
1031
1031
  if after_nonid_op?{false} #prefix form
1032
1032
  result.first.has_end!
@@ -1038,7 +1038,6 @@ private
1038
1038
  end
1039
1039
  return result
1040
1040
  end
1041
-
1042
1041
  alias keyword_until keyword_while
1043
1042
 
1044
1043
  def keyword_for(str,offset,result)
@@ -1050,6 +1049,7 @@ private
1050
1049
  @parsestack.push ForSMContext.new(@linenum)
1051
1050
  return result
1052
1051
  end
1052
+
1053
1053
  def keyword_do(str,offset,result)
1054
1054
  result.unshift(*abort_noparens_for_do!(str))
1055
1055
  if ExpectDoOrNlContext===@parsestack.last
@@ -2153,7 +2153,6 @@ end
2153
2153
  @offset_adjust=@min_offset_adjust
2154
2154
 
2155
2155
  @moretokens.unshift(*optional_here_bodies)
2156
- result=@moretokens.shift
2157
2156
 
2158
2157
  #adjust line count in fal to account for newlines in here bodys
2159
2158
  i=@moretokens.size-1
@@ -2168,12 +2167,13 @@ end
2168
2167
  end
2169
2168
 
2170
2169
  if pre_fal
2171
- @moretokens.unshift result
2170
+ result=@moretokens.first
2172
2171
  pre.offset=result.offset
2173
- result=pre
2172
+ @moretokens.unshift pre
2174
2173
  end
2175
2174
  start_of_line_directives
2176
2175
 
2176
+ result=@moretokens.shift
2177
2177
  return result
2178
2178
  end
2179
2179
 
@@ -1,3 +1,3 @@
1
1
  class RubyLexer
2
- VERSION='0.7.4'
2
+ VERSION='0.7.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubylexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clausen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: ""
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-22 00:00:00 -07:00
12
+ date: 2009-05-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency