walrat 0.1 → 0.3.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.
- checksums.yaml +7 -0
- data/lib/walrat/additions/proc.rb +2 -21
- data/lib/walrat/additions/regexp.rb +3 -22
- data/lib/walrat/additions/string.rb +2 -34
- data/lib/walrat/additions/symbol.rb +3 -22
- data/lib/walrat/and_predicate.rb +2 -21
- data/lib/walrat/array_result.rb +2 -21
- data/lib/walrat/continuation_wrapper_exception.rb +2 -21
- data/lib/walrat/grammar.rb +9 -27
- data/lib/walrat/left_recursion_exception.rb +2 -21
- data/lib/walrat/location_tracking.rb +5 -26
- data/lib/walrat/match_data_wrapper.rb +2 -21
- data/lib/walrat/memoizing.rb +3 -23
- data/lib/walrat/memoizing_cache.rb +3 -23
- data/lib/walrat/no_parameter_marker.rb +3 -22
- data/lib/walrat/node.rb +4 -23
- data/lib/walrat/not_predicate.rb +2 -21
- data/lib/walrat/parse_error.rb +2 -21
- data/lib/walrat/parser_state.rb +2 -21
- data/lib/walrat/parslet.rb +2 -21
- data/lib/walrat/parslet_choice.rb +2 -21
- data/lib/walrat/parslet_combination.rb +2 -21
- data/lib/walrat/parslet_combining.rb +22 -90
- data/lib/walrat/parslet_merge.rb +2 -21
- data/lib/walrat/parslet_omission.rb +2 -21
- data/lib/walrat/parslet_repetition.rb +2 -21
- data/lib/walrat/parslet_repetition_default.rb +2 -21
- data/lib/walrat/parslet_sequence.rb +2 -21
- data/lib/walrat/predicate.rb +2 -21
- data/lib/walrat/proc_parslet.rb +2 -21
- data/lib/walrat/regexp_parslet.rb +2 -21
- data/lib/walrat/skipped_substring_exception.rb +2 -21
- data/lib/walrat/string_enumerator.rb +2 -23
- data/lib/walrat/string_parslet.rb +2 -21
- data/lib/walrat/string_result.rb +3 -22
- data/lib/walrat/symbol_parslet.rb +2 -21
- data/lib/walrat/version.rb +4 -23
- data/lib/walrat.rb +3 -28
- metadata +54 -54
data/lib/walrat/string_result.rb
CHANGED
@@ -1,30 +1,11 @@
|
|
1
|
-
# Copyright 2007-
|
2
|
-
#
|
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
|
8
|
+
include LocationTracking
|
28
9
|
|
29
10
|
def initialize string = ""
|
30
11
|
self.source_text = string
|
@@ -1,24 +1,5 @@
|
|
1
|
-
# Copyright 2007-
|
2
|
-
#
|
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
|
|
data/lib/walrat/version.rb
CHANGED
@@ -1,26 +1,7 @@
|
|
1
|
-
# Copyright 2007-
|
2
|
-
#
|
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.
|
25
|
-
COPYRIGHT = 'Copyright 2007-
|
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-
|
2
|
-
#
|
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
|
-
|
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
|
-
|
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
|
-
-
|
6
|
+
authors:
|
7
|
+
- Greg Hurrell
|
12
8
|
autorequire:
|
13
9
|
bindir: bin
|
14
10
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
23
|
-
requirements:
|
24
|
-
- - "
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
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:
|
108
|
+
specification_version: 4
|
108
109
|
summary: Object-oriented templating system
|
109
110
|
test_files: []
|
110
|
-
|