rbscmlex 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/rbscmlex +1 -1
- data/lib/rbscmlex/token.rb +8 -2
- data/lib/rbscmlex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d945c95432fbcd698af635fd0d4a9e0f54a468270fc6f6e8c5a69df7202b1f3
|
4
|
+
data.tar.gz: b359cb4c75e7082e961714d0994ed3d503a81796bbbf51c489c6e32c62dfc819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f3da67c6a2479b94fb9a7fff6c6c89c03e0f386f94418a16d3ff751e505839f62deb2437127607e7259d51e1c8204c7583e3d5207c944ba0114b996f7f212bb
|
7
|
+
data.tar.gz: c0a68a273da923404f3cc3051f5850250076edff9bb4637523f3b5667862d7c6b1d64b348998c0c8c2f8604f10daf364c3918928cccd0304f7ed6468585ca289
|
data/CHANGELOG.md
CHANGED
@@ -7,5 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
## [Unreleased]
|
8
8
|
- (nothing to record here)
|
9
9
|
|
10
|
+
## [0.1.1] - 2021-05-06
|
11
|
+
### Fixed
|
12
|
+
- Fix issue #1: `rbscmlex` fails to read from STDIN.
|
13
|
+
|
10
14
|
## [0.1.0] - 2021-05-06
|
11
15
|
- Initial release
|
data/exe/rbscmlex
CHANGED
data/lib/rbscmlex/token.rb
CHANGED
@@ -50,9 +50,9 @@ module Rbscmlex
|
|
50
50
|
when :token
|
51
51
|
Token.new(type, literal)
|
52
52
|
when :hash
|
53
|
-
|
53
|
+
make_hash(type, literal)
|
54
54
|
when :json
|
55
|
-
JSON.generate(
|
55
|
+
JSON.generate(make_hash(type, literal))
|
56
56
|
else
|
57
57
|
raise InvalidConversionTypeError, "cannot generate #{type} as token"
|
58
58
|
end
|
@@ -64,6 +64,12 @@ module Rbscmlex
|
|
64
64
|
TOKEN_TYPES.include?(type)
|
65
65
|
end
|
66
66
|
|
67
|
+
# Returns a new Hash object with type and literal.
|
68
|
+
|
69
|
+
def make_hash(type, literal)
|
70
|
+
{type: type, literal: literal}
|
71
|
+
end
|
72
|
+
|
67
73
|
# Converts a Hash object, which has type and literal as its key,
|
68
74
|
# to a new token object. The value associated to type of the Hash
|
69
75
|
# must be valid token type. Otherwise, raises UnknownTokenTypeError.
|
data/lib/rbscmlex/version.rb
CHANGED