paco 0.2.2 → 0.2.3
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/paco/version.rb +1 -1
- data/lib/paco.rb +3 -2
- metadata +9 -24
- data/lib/.rbnext/2.6/paco/context.rb +0 -51
- /data/lib/.rbnext/{2.5/paco → paco}/combinators.rb +0 -0
- /data/lib/.rbnext/{2.3/paco → paco}/context.rb +0 -0
- /data/lib/.rbnext/{2.3/paco → paco}/index.rb +0 -0
- /data/lib/.rbnext/{2.3/paco → paco}/parse_error.rb +0 -0
- /data/lib/.rbnext/{2.5/paco → paco}/parser.rb +0 -0
- /data/lib/.rbnext/{2.5/paco → paco}/rspec/parse_matcher.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33b91a49bb7dd72f8ca4217ab79949a911544b3a741088b05bc62cc38e09cb05
|
4
|
+
data.tar.gz: 7567277a97be383523040abcd78882a27a2bb149c31208f92d2e840c934feefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5cdcf9f6aedcb5b4b52332ede84f3f4f4adb443836c8c79c69e50a75ad2594355374faaf0f986ca4cf8ec19de9bff9cc890c86160425bb4fd33e16333853f37
|
7
|
+
data.tar.gz: b0875c0886ca461193b3c68f5b06a7e50161b58a2300c7fcbe11422c07118370c8a07eef614a9aaf09b13ed9d46c325ebbd3fb74e3ccf85de23201ebeff580af
|
data/CHANGELOG.md
CHANGED
data/lib/paco/version.rb
CHANGED
data/lib/paco.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
if RUBY_VERSION < "2.6.0"
|
4
|
+
$LOAD_PATH.unshift File.expand_path("./.rbnext", __dir__)
|
5
|
+
end
|
5
6
|
|
6
7
|
require "paco/version"
|
7
8
|
require "paco/parse_error"
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svyatoslav Kryukov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: ruby-next-core
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.15.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.15.0
|
11
|
+
date: 2023-08-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: Paco is a parser combinator library.
|
28
14
|
email:
|
29
15
|
- s.g.kryukov@yandex.ru
|
@@ -34,13 +20,12 @@ files:
|
|
34
20
|
- CHANGELOG.md
|
35
21
|
- LICENSE.txt
|
36
22
|
- README.md
|
37
|
-
- lib/.rbnext/
|
38
|
-
- lib/.rbnext/
|
39
|
-
- lib/.rbnext/
|
40
|
-
- lib/.rbnext/
|
41
|
-
- lib/.rbnext/
|
42
|
-
- lib/.rbnext/
|
43
|
-
- lib/.rbnext/2.6/paco/context.rb
|
23
|
+
- lib/.rbnext/paco/combinators.rb
|
24
|
+
- lib/.rbnext/paco/context.rb
|
25
|
+
- lib/.rbnext/paco/index.rb
|
26
|
+
- lib/.rbnext/paco/parse_error.rb
|
27
|
+
- lib/.rbnext/paco/parser.rb
|
28
|
+
- lib/.rbnext/paco/rspec/parse_matcher.rb
|
44
29
|
- lib/paco.rb
|
45
30
|
- lib/paco/callstack.rb
|
46
31
|
- lib/paco/combinators.rb
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "paco/callstack"
|
4
|
-
require "paco/index"
|
5
|
-
|
6
|
-
module Paco
|
7
|
-
class Context
|
8
|
-
attr_reader :input, :last_pos, :callstack
|
9
|
-
attr_accessor :pos
|
10
|
-
|
11
|
-
def initialize(input, pos: 0, with_callstack: false)
|
12
|
-
@input = input
|
13
|
-
@pos = pos
|
14
|
-
@callstack = Callstack.new if with_callstack
|
15
|
-
end
|
16
|
-
|
17
|
-
def read(n)
|
18
|
-
input[pos, n]
|
19
|
-
end
|
20
|
-
|
21
|
-
def read_all
|
22
|
-
input[pos..-1]
|
23
|
-
end
|
24
|
-
|
25
|
-
def eof?
|
26
|
-
pos >= input.length
|
27
|
-
end
|
28
|
-
|
29
|
-
# @param [Integer] from
|
30
|
-
# @return [Paco::Index]
|
31
|
-
def index(from = nil)
|
32
|
-
Index.calculate(input: input, pos: from || pos)
|
33
|
-
end
|
34
|
-
|
35
|
-
# @param [Paco::Parser] parser
|
36
|
-
def failure_parse(parser)
|
37
|
-
@callstack&.failure(pos: pos, parser: parser.desc)
|
38
|
-
end
|
39
|
-
|
40
|
-
# @param [Paco::Parser] parser
|
41
|
-
def start_parse(parser)
|
42
|
-
@callstack&.start(pos: pos, parser: parser.desc)
|
43
|
-
end
|
44
|
-
|
45
|
-
# @param [Object] result
|
46
|
-
# @param [Paco::Parser] parser
|
47
|
-
def success_parse(result, parser)
|
48
|
-
@callstack&.success(pos: pos, result: result, parser: parser.desc)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|