farseer 0.8.0 → 0.9.0
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 +12 -0
- data/SECURITY.md +2 -2
- data/lib/farseer/and.rb +2 -2
- data/lib/farseer/empty.rb +15 -0
- data/lib/farseer/result.rb +3 -3
- data/lib/farseer/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f6d2e808d2e8ac8a9b119598834508dc1482f0cfaf68c34737fefb4bd261db6
|
4
|
+
data.tar.gz: 7282626a92655eb5b4044edef19689042127e22fb83e7751b5128c80f3749a89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f970a3b6804799587f2e715de0bff16efbaa6904e86259f735f6d417c5590cf0eb8bda85349509782c0258a215405c55c285159f7e31905406d08340891c3453
|
7
|
+
data.tar.gz: 7c5eaffc7d1b135bff0eae234f1322c1ded4971e0c8a68bfcd47cd43783037193d242a39e3fd2a59e06d76a267e8543967e1cde846f5dea7f2db03deb08d5ef9
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.9.0] - 2024-06-11
|
11
|
+
### Added
|
12
|
+
- `Farseer::Empty` which always succeeds and parses nothing, returning the whole
|
13
|
+
string as rest.
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- Change usage of `#eql?` to `#==` in `Farseer::Result`.
|
17
|
+
- `Farseer::And` does not join the resulting tokens anymore, but rather return
|
18
|
+
an array of tokens.
|
19
|
+
- Remove all development dependencies from `Gemfile` in favor of having
|
20
|
+
`lollipop` in the `gemspec`.
|
21
|
+
|
10
22
|
## [0.8.0] - 2024-06-04
|
11
23
|
### Added
|
12
24
|
- `Farseer::Map` which is a parser with a callback to map the resulting token
|
data/SECURITY.md
CHANGED
data/lib/farseer/and.rb
CHANGED
@@ -12,7 +12,7 @@ module Farseer
|
|
12
12
|
def parse(input)
|
13
13
|
return Maybe.none if @parsers.empty?
|
14
14
|
|
15
|
-
initial = Maybe.return(Result.new(
|
15
|
+
initial = Maybe.return(Result.new([], input))
|
16
16
|
|
17
17
|
@parsers.reduce(initial) do |maybe_acc, parser|
|
18
18
|
bind_accumulator(maybe_acc, parser)
|
@@ -32,7 +32,7 @@ module Farseer
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def combine_results(acc_result, result)
|
35
|
-
combined_tokens = acc_result.token + result.token
|
35
|
+
combined_tokens = acc_result.token + [result.token]
|
36
36
|
Maybe.return(Result.new(combined_tokens, result.rest))
|
37
37
|
end
|
38
38
|
end
|
data/lib/farseer/result.rb
CHANGED
@@ -9,11 +9,11 @@ module Farseer
|
|
9
9
|
end
|
10
10
|
attr_reader :token, :rest
|
11
11
|
|
12
|
-
def
|
12
|
+
def ==(other)
|
13
13
|
self.class.eql?(other.class) and
|
14
|
-
token
|
14
|
+
token == (other.token) and
|
15
15
|
rest.eql?(other.rest)
|
16
16
|
end
|
17
|
-
alias
|
17
|
+
alias eql? ==
|
18
18
|
end
|
19
19
|
end
|
data/lib/farseer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: farseer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaporyhumo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: muina
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: lollipop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.5'
|
41
55
|
description: Functional Parsing Library for Ruby
|
42
56
|
email:
|
43
57
|
- roanvilina@gmail.com
|
@@ -54,6 +68,7 @@ files:
|
|
54
68
|
- lib/farseer/any.rb
|
55
69
|
- lib/farseer/char.rb
|
56
70
|
- lib/farseer/chars.rb
|
71
|
+
- lib/farseer/empty.rb
|
57
72
|
- lib/farseer/many.rb
|
58
73
|
- lib/farseer/map.rb
|
59
74
|
- lib/farseer/map_factory.rb
|