rubylexer 0.7.7 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -0
  2. data/History.txt +64 -0
  3. data/Makefile +2 -2
  4. data/README.txt +13 -9
  5. data/bin/rubylexer +113 -0
  6. data/lib/assert.rb +1 -1
  7. data/lib/rubylexer.rb +856 -305
  8. data/lib/rubylexer/charhandler.rb +1 -1
  9. data/lib/rubylexer/charset.rb +15 -7
  10. data/lib/rubylexer/context.rb +10 -2
  11. data/lib/rubylexer/lextable.rb +1 -0
  12. data/lib/rubylexer/rubycode.rb +1 -1
  13. data/lib/rubylexer/rulexer.rb +106 -32
  14. data/lib/rubylexer/symboltable.rb +1 -1
  15. data/lib/rubylexer/test/oneliners.rb +15 -5
  16. data/lib/rubylexer/test/oneliners_1.9.rb +116 -92
  17. data/lib/rubylexer/test/stanzas.rb +49 -27
  18. data/lib/rubylexer/test/testcases.rb +2 -2
  19. data/lib/rubylexer/token.rb +153 -23
  20. data/lib/rubylexer/tokenprinter.rb +9 -6
  21. data/lib/rubylexer/version.rb +1 -1
  22. data/rubylexer.gemspec +12 -8
  23. data/test/bad/ruby_lexer.rb +7 -0
  24. data/test/code/deletewarns.rb +1 -1
  25. data/test/code/dumptokens.rb +1 -81
  26. data/test/code/heredoc_blast_test.rb +112 -0
  27. data/test/code/locatetest.rb +1 -1
  28. data/test/code/regression.rb +23 -23
  29. data/test/code/rubylexervsruby.rb +59 -12
  30. data/test/code/tokentest.rb +62 -52
  31. data/test/data/23.rb +0 -1
  32. data/test/data/g.rb +0 -1
  33. data/test/data/heremonsters.rb +1 -1
  34. data/test/data/heremonsters_dos.rb +1 -1
  35. data/test/data/pre.rb +0 -1
  36. data/test/data/pre.unix.rb +0 -1
  37. data/test/data/putstext.rb +4 -0
  38. data/test/data/regtest.rb +0 -1
  39. data/test/data/stuffydog.rb +5 -0
  40. data/test/data/stuffydog2.rb +5 -0
  41. data/test/data/wsdlDriver.rb +0 -1
  42. data/test/test.sh +1 -1
  43. data/test/test_all.rb +3 -0
  44. data/test/test_bad_rubylexer.rb +16 -0
  45. data/test/test_rubylexer_bad.rb +12 -0
  46. data/testing.txt +40 -20
  47. metadata +51 -38
metadata CHANGED
@@ -1,43 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubylexer
3
- version: !ruby/object:Gem::Version
4
- version: 0.7.7
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Caleb Clausen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2010-01-03 00:00:00 -08:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
16
14
  name: sequence
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.4
17
20
  type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
21
24
  - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.2.3
24
- version:
25
- description: RubyLexer is a lexer library for Ruby, written in Ruby. Rubylexer is meant as a lexer for Ruby that's complete and correct; all legal Ruby code should be lexed correctly by RubyLexer as well. Just enough parsing capability is included to give RubyLexer enough context to tokenize correctly in all cases. (This turned out to be more parsing than I had thought or wanted to take on at first.) RubyLexer handles the hard things like complicated strings, the ambiguous nature of some punctuation characters and keywords in ruby, and distinguishing methods and local variables. RubyLexer is not particularly clean code. As I progressed in writing this, I've learned a little about how these things are supposed to be done; the lexer is not supposed to have any state of it's own, instead it gets whatever it needs to know from the parser. As a stand-alone lexer, Rubylexer maintains quite a lot of state. Every instance variable in the RubyLexer class is some sort of lexer state. Most of the complication and ugly code in RubyLexer is in maintaining or using this state.
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.4
27
+ description: "RubyLexer is a lexer library for Ruby, written in Ruby. Rubylexer is
28
+ meant\nas a lexer for Ruby that's complete and correct; all legal Ruby \ncode should
29
+ be lexed correctly by RubyLexer as well. Just enough parsing \ncapability is included
30
+ to give RubyLexer enough context to tokenize correctly\nin all cases. (This turned
31
+ out to be more parsing than I had thought or \nwanted to take on at first.) RubyLexer
32
+ handles the hard things like \ncomplicated strings, the ambiguous nature of some
33
+ punctuation characters and \nkeywords in ruby, and distinguishing methods and local
34
+ variables. It should\nbe able to correctly lex 99.9+% of legal ruby code."
26
35
  email: caleb (at) inforadical (dot) net
27
36
  executables: []
28
-
29
37
  extensions: []
30
-
31
- extra_rdoc_files:
38
+ extra_rdoc_files:
32
39
  - README.txt
33
40
  - COPYING
34
- files:
35
- - .document
41
+ files:
42
+ - ".document"
36
43
  - COPYING
37
44
  - History.txt
38
45
  - Makefile
39
46
  - Manifest.txt
40
47
  - README.txt
48
+ - bin/rubylexer
41
49
  - howtouse.txt
42
50
  - lib/.document
43
51
  - lib/assert.rb
@@ -64,6 +72,7 @@ files:
64
72
  - lib/rubylexer/tokenprinter.rb
65
73
  - lib/rubylexer/version.rb
66
74
  - rubylexer.gemspec
75
+ - test/bad/ruby_lexer.rb
67
76
  - test/code/all_the_gems.rb
68
77
  - test/code/all_the_raas.rb
69
78
  - test/code/all_the_rubies.rb
@@ -71,6 +80,7 @@ files:
71
80
  - test/code/deletewarns.rb
72
81
  - test/code/dumptokens.rb
73
82
  - test/code/errscan
83
+ - test/code/heredoc_blast_test.rb
74
84
  - test/code/isolate_error.rb
75
85
  - test/code/lexloop
76
86
  - test/code/locatetest
@@ -134,6 +144,7 @@ files:
134
144
  - test/data/pleac.rb.broken
135
145
  - test/data/pre.rb
136
146
  - test/data/pre.unix.rb
147
+ - test/data/putstext.rb
137
148
  - test/data/regtest.rb
138
149
  - test/data/rescue.rb
139
150
  - test/data/s.rb
@@ -145,6 +156,8 @@ files:
145
156
  - test/data/stuff2.rb
146
157
  - test/data/stuff3.rb
147
158
  - test/data/stuff4.rb
159
+ - test/data/stuffydog.rb
160
+ - test/data/stuffydog2.rb
148
161
  - test/data/tkweird.rb
149
162
  - test/data/unending_stuff.rb
150
163
  - test/data/untermed_here.rb.broken
@@ -156,33 +169,33 @@ files:
156
169
  - test/data/wsdlDriver.rb
157
170
  - test/test.sh
158
171
  - test/test_all.rb
172
+ - test/test_bad_rubylexer.rb
173
+ - test/test_rubylexer_bad.rb
159
174
  - testing.txt
160
- has_rdoc: true
161
175
  homepage: http://github.com/coatl/rubylexer
176
+ licenses: []
177
+ metadata: {}
162
178
  post_install_message:
163
- rdoc_options:
164
- - --main
179
+ rdoc_options:
180
+ - "--main"
165
181
  - README.txt
166
- require_paths:
182
+ require_paths:
167
183
  - lib
168
- required_ruby_version: !ruby/object:Gem::Requirement
169
- requirements:
184
+ required_ruby_version: !ruby/object:Gem::Requirement
185
+ requirements:
170
186
  - - ">="
171
- - !ruby/object:Gem::Version
172
- version: "0"
173
- version:
174
- required_rubygems_version: !ruby/object:Gem::Requirement
175
- requirements:
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ required_rubygems_version: !ruby/object:Gem::Requirement
190
+ requirements:
176
191
  - - ">="
177
- - !ruby/object:Gem::Version
178
- version: "0"
179
- version:
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
180
194
  requirements: []
181
-
182
195
  rubyforge_project: rubylexer
183
- rubygems_version: 1.3.1
196
+ rubygems_version: 2.5.1
184
197
  signing_key:
185
198
  specification_version: 2
186
199
  summary: RubyLexer is a lexer library for Ruby, written in Ruby.
187
- test_files:
200
+ test_files:
188
201
  - test/test_all.rb