parslet 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README +1 -1
  3. data/lib/parslet/context.rb +1 -1
  4. data/lib/parslet/parser.rb +1 -1
  5. data/parslet.gemspec +18 -0
  6. data/spec/acceptance/examples_spec.rb +37 -0
  7. data/spec/acceptance/infix_parser_spec.rb +112 -0
  8. data/spec/acceptance/regression_spec.rb +314 -0
  9. data/spec/acceptance/repetition_and_maybe_spec.rb +42 -0
  10. data/spec/acceptance/unconsumed_input_spec.rb +21 -0
  11. data/spec/parslet/atom_results_spec.rb +39 -0
  12. data/spec/parslet/atoms/alternative_spec.rb +26 -0
  13. data/spec/parslet/atoms/base_spec.rb +126 -0
  14. data/spec/parslet/atoms/capture_spec.rb +21 -0
  15. data/spec/parslet/atoms/combinations_spec.rb +5 -0
  16. data/spec/parslet/atoms/dsl_spec.rb +25 -0
  17. data/spec/parslet/atoms/entity_spec.rb +77 -0
  18. data/spec/parslet/atoms/infix_spec.rb +5 -0
  19. data/spec/parslet/atoms/lookahead_spec.rb +22 -0
  20. data/spec/parslet/atoms/named_spec.rb +4 -0
  21. data/spec/parslet/atoms/re_spec.rb +14 -0
  22. data/spec/parslet/atoms/repetition_spec.rb +24 -0
  23. data/spec/parslet/atoms/scope_spec.rb +26 -0
  24. data/spec/parslet/atoms/sequence_spec.rb +28 -0
  25. data/spec/parslet/atoms/str_spec.rb +15 -0
  26. data/spec/parslet/atoms/visitor_spec.rb +80 -0
  27. data/spec/parslet/atoms_spec.rb +429 -0
  28. data/spec/parslet/convenience_spec.rb +48 -0
  29. data/spec/parslet/error_reporter/contextual_spec.rb +115 -0
  30. data/spec/parslet/error_reporter/deepest_spec.rb +73 -0
  31. data/spec/parslet/error_reporter/tree_spec.rb +7 -0
  32. data/spec/parslet/export_spec.rb +67 -0
  33. data/spec/parslet/expression/treetop_spec.rb +74 -0
  34. data/spec/parslet/minilisp.citrus +29 -0
  35. data/spec/parslet/minilisp.tt +29 -0
  36. data/spec/parslet/parser_spec.rb +31 -0
  37. data/spec/parslet/parslet_spec.rb +38 -0
  38. data/spec/parslet/pattern_spec.rb +272 -0
  39. data/spec/parslet/position_spec.rb +14 -0
  40. data/spec/parslet/rig/rspec_spec.rb +54 -0
  41. data/spec/parslet/scope_spec.rb +45 -0
  42. data/spec/parslet/slice_spec.rb +144 -0
  43. data/spec/parslet/source/line_cache_spec.rb +74 -0
  44. data/spec/parslet/source_spec.rb +168 -0
  45. data/spec/parslet/transform/context_spec.rb +35 -0
  46. data/spec/parslet/transform_spec.rb +165 -0
  47. data/spec/spec_helper.rb +38 -0
  48. metadata +46 -4
@@ -0,0 +1,38 @@
1
+
2
+ require 'parslet'
3
+
4
+ require 'parslet/rig/rspec'
5
+ require 'parslet/atoms/visitor'
6
+ require 'parslet/export'
7
+
8
+ RSpec.configure do |config|
9
+ config.mock_with :flexmock
10
+
11
+ begin
12
+ # Here's to the worst idea ever, rspec. This is why we'll be leaving you soon.
13
+ config.expect_with :rspec do |c|
14
+ c.syntax = [:should, :expect]
15
+ end
16
+ rescue NoMethodError
17
+ # If the feature is missing, ignore it.
18
+ end
19
+
20
+ # Exclude other ruby versions by giving :ruby => 1.8 or :ruby => 1.9
21
+ #
22
+ config.filter_run_excluding :ruby => lambda { |version|
23
+ RUBY_VERSION.to_s !~ /^#{Regexp.escape(version.to_s)}/
24
+ }
25
+ end
26
+
27
+ def catch_failed_parse
28
+ begin
29
+ yield
30
+ rescue Parslet::ParseFailed => exception
31
+ end
32
+ exception.cause
33
+ end
34
+
35
+ def slet name, &block
36
+ let(name, &block)
37
+ subject(&block)
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parslet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaspar Schiess
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blankslate
@@ -141,6 +141,49 @@ files:
141
141
  - lib/parslet/source.rb
142
142
  - lib/parslet/source/line_cache.rb
143
143
  - lib/parslet/transform.rb
144
+ - parslet.gemspec
145
+ - spec/acceptance/examples_spec.rb
146
+ - spec/acceptance/infix_parser_spec.rb
147
+ - spec/acceptance/regression_spec.rb
148
+ - spec/acceptance/repetition_and_maybe_spec.rb
149
+ - spec/acceptance/unconsumed_input_spec.rb
150
+ - spec/parslet/atom_results_spec.rb
151
+ - spec/parslet/atoms/alternative_spec.rb
152
+ - spec/parslet/atoms/base_spec.rb
153
+ - spec/parslet/atoms/capture_spec.rb
154
+ - spec/parslet/atoms/combinations_spec.rb
155
+ - spec/parslet/atoms/dsl_spec.rb
156
+ - spec/parslet/atoms/entity_spec.rb
157
+ - spec/parslet/atoms/infix_spec.rb
158
+ - spec/parslet/atoms/lookahead_spec.rb
159
+ - spec/parslet/atoms/named_spec.rb
160
+ - spec/parslet/atoms/re_spec.rb
161
+ - spec/parslet/atoms/repetition_spec.rb
162
+ - spec/parslet/atoms/scope_spec.rb
163
+ - spec/parslet/atoms/sequence_spec.rb
164
+ - spec/parslet/atoms/str_spec.rb
165
+ - spec/parslet/atoms/visitor_spec.rb
166
+ - spec/parslet/atoms_spec.rb
167
+ - spec/parslet/convenience_spec.rb
168
+ - spec/parslet/error_reporter/contextual_spec.rb
169
+ - spec/parslet/error_reporter/deepest_spec.rb
170
+ - spec/parslet/error_reporter/tree_spec.rb
171
+ - spec/parslet/export_spec.rb
172
+ - spec/parslet/expression/treetop_spec.rb
173
+ - spec/parslet/minilisp.citrus
174
+ - spec/parslet/minilisp.tt
175
+ - spec/parslet/parser_spec.rb
176
+ - spec/parslet/parslet_spec.rb
177
+ - spec/parslet/pattern_spec.rb
178
+ - spec/parslet/position_spec.rb
179
+ - spec/parslet/rig/rspec_spec.rb
180
+ - spec/parslet/scope_spec.rb
181
+ - spec/parslet/slice_spec.rb
182
+ - spec/parslet/source/line_cache_spec.rb
183
+ - spec/parslet/source_spec.rb
184
+ - spec/parslet/transform/context_spec.rb
185
+ - spec/parslet/transform_spec.rb
186
+ - spec/spec_helper.rb
144
187
  homepage: http://kschiess.github.io/parslet
145
188
  licenses:
146
189
  - MIT
@@ -163,9 +206,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
206
  version: '0'
164
207
  requirements: []
165
208
  rubyforge_project:
166
- rubygems_version: 2.2.2
209
+ rubygems_version: 2.4.5
167
210
  signing_key:
168
211
  specification_version: 4
169
212
  summary: Parser construction library with great error reporting in Ruby.
170
213
  test_files: []
171
- has_rdoc: