vernacular 0.1.1 → 0.1.2
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/lib/vernacular/ast_parser.rb +12 -5
- data/lib/vernacular/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ae148c9d3c9c69aeceffad4bc1f16ea21e5514d
|
4
|
+
data.tar.gz: 209e7af5273d7b6925a60f6238ed2fed4f5460ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dd6ec7445cc90d6a346bb1d1ba248731c514a7981c9885ba1c845347bd71fa47812519e3c5588e8b467a81243f809f60a2d6b877f6bb1cf9041ac4cb8347f39
|
7
|
+
data.tar.gz: c07d353edea1eb702c78b1dc2482d35edd0d76994c6ead7cc1035ae60569974af975fa855d809647a169718ac44bf7eabe74614067c90390dcb9afd3a69b6fa8
|
@@ -12,7 +12,7 @@ module Vernacular
|
|
12
12
|
end
|
13
13
|
|
14
14
|
write_parser(source)
|
15
|
-
load
|
15
|
+
load PARSER_PATH
|
16
16
|
Parser::Vernacular.new(builder)
|
17
17
|
end
|
18
18
|
|
@@ -48,10 +48,12 @@ module Vernacular
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def compile_parser(filepath)
|
51
|
-
output = File.expand_path('../parser.rb', __FILE__)
|
52
51
|
exec_path = Gem.activate_bin_path('racc', 'racc', [])
|
53
|
-
`#{exec_path} --superclass=Parser::Base -o #{
|
54
|
-
File.write(
|
52
|
+
`#{exec_path} --superclass=Parser::Base -o #{PARSER_PATH} #{filepath}`
|
53
|
+
File.write(
|
54
|
+
PARSER_PATH,
|
55
|
+
File.read(PARSER_PATH).gsub("Ruby#{parser_version}", 'Vernacular')
|
56
|
+
)
|
55
57
|
end
|
56
58
|
|
57
59
|
# rubocop:disable Metrics/MethodLength
|
@@ -73,7 +75,12 @@ module Vernacular
|
|
73
75
|
|
74
76
|
def parser_source
|
75
77
|
filepath, = Parser.method(:check_for_encoding_support).source_location
|
76
|
-
|
78
|
+
grammar_filepath = "../../lib/parser/ruby#{parser_version}.y"
|
79
|
+
File.read(File.expand_path(grammar_filepath, filepath))
|
80
|
+
end
|
81
|
+
|
82
|
+
def parser_version
|
83
|
+
@parser_version ||= RUBY_VERSION.gsub(/\A(\d)\.(\d).+/, '\1\2')
|
77
84
|
end
|
78
85
|
|
79
86
|
def write_parser(source)
|
data/lib/vernacular/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vernacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Deisz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|