walrat 0.1 → 0.3.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/lib/walrat/additions/proc.rb +2 -21
  3. data/lib/walrat/additions/regexp.rb +3 -22
  4. data/lib/walrat/additions/string.rb +2 -34
  5. data/lib/walrat/additions/symbol.rb +3 -22
  6. data/lib/walrat/and_predicate.rb +2 -21
  7. data/lib/walrat/array_result.rb +2 -21
  8. data/lib/walrat/continuation_wrapper_exception.rb +2 -21
  9. data/lib/walrat/grammar.rb +9 -27
  10. data/lib/walrat/left_recursion_exception.rb +2 -21
  11. data/lib/walrat/location_tracking.rb +5 -26
  12. data/lib/walrat/match_data_wrapper.rb +2 -21
  13. data/lib/walrat/memoizing.rb +3 -23
  14. data/lib/walrat/memoizing_cache.rb +3 -23
  15. data/lib/walrat/no_parameter_marker.rb +3 -22
  16. data/lib/walrat/node.rb +4 -23
  17. data/lib/walrat/not_predicate.rb +2 -21
  18. data/lib/walrat/parse_error.rb +2 -21
  19. data/lib/walrat/parser_state.rb +2 -21
  20. data/lib/walrat/parslet.rb +2 -21
  21. data/lib/walrat/parslet_choice.rb +2 -21
  22. data/lib/walrat/parslet_combination.rb +2 -21
  23. data/lib/walrat/parslet_combining.rb +22 -90
  24. data/lib/walrat/parslet_merge.rb +2 -21
  25. data/lib/walrat/parslet_omission.rb +2 -21
  26. data/lib/walrat/parslet_repetition.rb +2 -21
  27. data/lib/walrat/parslet_repetition_default.rb +2 -21
  28. data/lib/walrat/parslet_sequence.rb +2 -21
  29. data/lib/walrat/predicate.rb +2 -21
  30. data/lib/walrat/proc_parslet.rb +2 -21
  31. data/lib/walrat/regexp_parslet.rb +2 -21
  32. data/lib/walrat/skipped_substring_exception.rb +2 -21
  33. data/lib/walrat/string_enumerator.rb +2 -23
  34. data/lib/walrat/string_parslet.rb +2 -21
  35. data/lib/walrat/string_result.rb +3 -22
  36. data/lib/walrat/symbol_parslet.rb +2 -21
  37. data/lib/walrat/version.rb +4 -23
  38. data/lib/walrat.rb +3 -28
  39. metadata +54 -54
@@ -1,30 +1,11 @@
1
- # Copyright 2007-2010 Wincent Colaiuta. All rights reserved.
2
- # Redistribution and use in source and binary forms, with or without
3
- # modification, are permitted provided that the following conditions are met:
4
- #
5
- # 1. Redistributions of source code must retain the above copyright notice,
6
- # this list of conditions and the following disclaimer.
7
- # 2. Redistributions in binary form must reproduce the above copyright notice,
8
- # this list of conditions and the following disclaimer in the documentation
9
- # and/or other materials provided with the distribution.
10
- #
11
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
15
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
16
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
17
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
19
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21
- # POSSIBILITY OF SUCH DAMAGE.
1
+ # Copyright 2007-present Greg Hurrell. All rights reserved.
2
+ # Licensed under the terms of the BSD 2-clause license.
22
3
 
23
4
  require 'walrat'
24
5
 
25
6
  module Walrat
26
7
  class StringResult < String
27
- include Walrat::LocationTracking
8
+ include LocationTracking
28
9
 
29
10
  def initialize string = ""
30
11
  self.source_text = string
@@ -1,24 +1,5 @@
1
- # Copyright 2007-2010 Wincent Colaiuta. All rights reserved.
2
- # Redistribution and use in source and binary forms, with or without
3
- # modification, are permitted provided that the following conditions are met:
4
- #
5
- # 1. Redistributions of source code must retain the above copyright notice,
6
- # this list of conditions and the following disclaimer.
7
- # 2. Redistributions in binary form must reproduce the above copyright notice,
8
- # this list of conditions and the following disclaimer in the documentation
9
- # and/or other materials provided with the distribution.
10
- #
11
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
15
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
16
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
17
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
19
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21
- # POSSIBILITY OF SUCH DAMAGE.
1
+ # Copyright 2007-present Greg Hurrell. All rights reserved.
2
+ # Licensed under the terms of the BSD 2-clause license.
22
3
 
23
4
  require 'walrat'
24
5
 
@@ -1,26 +1,7 @@
1
- # Copyright 2007-2010 Wincent Colaiuta. All rights reserved.
2
- # Redistribution and use in source and binary forms, with or without
3
- # modification, are permitted provided that the following conditions are met:
4
- #
5
- # 1. Redistributions of source code must retain the above copyright notice,
6
- # this list of conditions and the following disclaimer.
7
- # 2. Redistributions in binary form must reproduce the above copyright notice,
8
- # this list of conditions and the following disclaimer in the documentation
9
- # and/or other materials provided with the distribution.
10
- #
11
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
15
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
16
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
17
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
19
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21
- # POSSIBILITY OF SUCH DAMAGE.
1
+ # Copyright 2007-present Greg Hurrell. All rights reserved.
2
+ # Licensed under the terms of the BSD 2-clause license.
22
3
 
23
4
  module Walrat
24
- VERSION = '0.1'
25
- COPYRIGHT = 'Copyright 2007-2010 Wincent Colaiuta'
5
+ VERSION = '0.3.pre'
6
+ COPYRIGHT = 'Copyright 2007-present Greg Hurrell'
26
7
  end # module Walrat
data/lib/walrat.rb CHANGED
@@ -1,34 +1,9 @@
1
- # Copyright 2007-2010 Wincent Colaiuta. All rights reserved.
2
- # Redistribution and use in source and binary forms, with or without
3
- # modification, are permitted provided that the following conditions are met:
4
- #
5
- # 1. Redistributions of source code must retain the above copyright notice,
6
- # this list of conditions and the following disclaimer.
7
- # 2. Redistributions in binary form must reproduce the above copyright notice,
8
- # this list of conditions and the following disclaimer in the documentation
9
- # and/or other materials provided with the distribution.
10
- #
11
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
12
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
15
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
16
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
17
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
19
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21
- # POSSIBILITY OF SUCH DAMAGE.
1
+ # Copyright 2007-present Greg Hurrell. All rights reserved.
2
+ # Licensed under the terms of the BSD 2-clause license.
22
3
 
23
- # Ruby 1.9 support
24
- require 'continuation' unless Kernel.respond_to?(:callcc)
4
+ require 'continuation'
25
5
 
26
6
  module Walrat
27
- major, minor = RUBY_VERSION.split '.'
28
- if major == '1' and minor == '8'
29
- $KCODE = 'U' # UTF-8 (necessary for Unicode support)
30
- end
31
-
32
7
  autoload :AndPredicate, 'walrat/and_predicate'
33
8
  autoload :ArrayResult, 'walrat/array_result'
34
9
  autoload :ContinuationWrapperException, 'walrat/continuation_wrapper_exception'
metadata CHANGED
@@ -1,44 +1,53 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: walrat
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- version: "0.1"
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.pre
9
5
  platform: ruby
10
- authors:
11
- - Wincent Colaiuta
6
+ authors:
7
+ - Greg Hurrell
12
8
  autorequire:
13
9
  bindir: bin
14
10
  cert_chain: []
15
-
16
- date: 2010-08-21 00:00:00 +02:00
17
- default_executable:
18
- dependencies:
19
- - !ruby/object:Gem::Dependency
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
20
14
  name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :development
21
21
  prerelease: false
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "="
25
- - !ruby/object:Gem::Version
26
- segments:
27
- - 1
28
- - 3
29
- - 0
30
- version: 1.3.0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: yard
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.8
31
34
  type: :development
32
- version_requirements: *id001
33
- description: " Walrat is a Parsing Expression Grammar (PEG) parser generator that\n creates integrated lexers, \"packrat\" parsers, and Abstract Syntax Tree\n (AST) builders.\n"
34
- email: win@wincent.com
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.8
41
+ description: |2
42
+ Walrat is a Parsing Expression Grammar (PEG) parser generator that
43
+ creates integrated lexers, "packrat" parsers, and Abstract Syntax Tree
44
+ (AST) builders.
45
+ email: greg@hurrell.net
35
46
  executables: []
36
-
37
47
  extensions: []
38
-
39
48
  extra_rdoc_files: []
40
-
41
- files:
49
+ files:
50
+ - lib/walrat.rb
42
51
  - lib/walrat/additions/proc.rb
43
52
  - lib/walrat/additions/regexp.rb
44
53
  - lib/walrat/additions/string.rb
@@ -75,36 +84,27 @@ files:
75
84
  - lib/walrat/string_result.rb
76
85
  - lib/walrat/symbol_parslet.rb
77
86
  - lib/walrat/version.rb
78
- - lib/walrat.rb
79
- has_rdoc: true
80
87
  homepage: https://wincent.com/products/walrat
81
- licenses: []
82
-
88
+ licenses:
89
+ - BSD-2-Clause
90
+ metadata: {}
83
91
  post_install_message:
84
92
  rdoc_options: []
85
-
86
- require_paths:
93
+ require_paths:
87
94
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- segments:
93
- - 0
94
- version: "0"
95
- required_rubygems_version: !ruby/object:Gem::Requirement
96
- requirements:
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
97
  - - ">="
98
- - !ruby/object:Gem::Version
99
- segments:
100
- - 0
101
- version: "0"
98
+ - !ruby/object:Gem::Version
99
+ version: '3.0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">"
103
+ - !ruby/object:Gem::Version
104
+ version: 1.3.1
102
105
  requirements: []
103
-
104
- rubyforge_project: walrus
105
- rubygems_version: 1.3.6
106
+ rubygems_version: 3.0.3.1
106
107
  signing_key:
107
- specification_version: 3
108
+ specification_version: 4
108
109
  summary: Object-oriented templating system
109
110
  test_files: []
110
-