expressir 0.2.15-x86-mingw32 → 0.2.16-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
- data/lib/expressir/express_exp/hyperlink_formatter.rb +1 -3
- data/lib/expressir/express_exp/schema_head_formatter.rb +1 -3
- data/lib/expressir/express_exp/visitor.rb +0 -24
- data/lib/expressir/model/schema.rb +0 -3
- data/lib/expressir/version.rb +1 -1
- data/spec/expressir/express_exp/hyperlink_formatter_spec.rb +5 -1
- data/spec/expressir/express_exp/schema_head_formatter_spec.rb +5 -1
- metadata +2 -3
- data/spec/expressir/express_exp/parser/head_source_spec.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03cb884d25b3c6258ba4de5103b834369d81c57afed35505afd8113d3d122a77
|
4
|
+
data.tar.gz: f901319bff19f5163f2716e8770f6165007663fea182dfa4f282378a304820d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202e644ede9056d1dbf38674e0d384908e0fd880c1cd0f1e2ebfb7eb33b29c84464c7fbc1eb38adf9f99de514b1d4bae2817905154f7b92933ba97707f9a85de
|
7
|
+
data.tar.gz: 39c82b2bda51e638ca394234f0075823251e01add99b3551518f06cc942958b1707dc30c781fd4c2e8827d788ea331a27a8b6657d55f258a09725d9eabfd4b4c
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,8 +1,6 @@
|
|
1
|
-
require "expressir/express_exp/formatter"
|
2
|
-
|
3
1
|
module Expressir
|
4
2
|
module ExpressExp
|
5
|
-
|
3
|
+
module HyperlinkFormatter
|
6
4
|
def format_expressions_simple_reference(node)
|
7
5
|
return node.id if node.parent.is_a? Model::Expressions::AttributeReference
|
8
6
|
|
@@ -92,35 +92,11 @@ module Expressir
|
|
92
92
|
@tokens[start_index..stop_index]
|
93
93
|
end
|
94
94
|
|
95
|
-
def get_head_tokens(ctx)
|
96
|
-
start_index, stop_index = if ctx.is_a? ::ExpressParser::SchemaDeclContext
|
97
|
-
start_index = ctx.start.token_index
|
98
|
-
stop_index = if ctx.schema_body.interface_specification.length > 0
|
99
|
-
ctx.schema_body.interface_specification.last.stop.token_index
|
100
|
-
elsif ctx.schema_version_id
|
101
|
-
ctx.schema_version_id.stop.token_index + 1
|
102
|
-
else
|
103
|
-
ctx.schema_id.stop.token_index + 1
|
104
|
-
end
|
105
|
-
|
106
|
-
[start_index, stop_index]
|
107
|
-
end
|
108
|
-
|
109
|
-
if start_index and stop_index
|
110
|
-
@tokens[start_index..stop_index]
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
95
|
def attach_source(ctx, node)
|
115
96
|
if node.class.method_defined? :source
|
116
97
|
tokens = get_tokens(ctx)
|
117
98
|
node.source = get_tokens_source(tokens)
|
118
99
|
end
|
119
|
-
|
120
|
-
if node.class.method_defined? :head_source
|
121
|
-
tokens = get_head_tokens(ctx)
|
122
|
-
node.head_source = get_tokens_source(tokens)
|
123
|
-
end
|
124
100
|
end
|
125
101
|
|
126
102
|
def find_remark_target(node, path)
|
@@ -5,8 +5,6 @@ module Expressir
|
|
5
5
|
|
6
6
|
include Identifier
|
7
7
|
|
8
|
-
attr_accessor :head_source
|
9
|
-
|
10
8
|
attr_accessor :version
|
11
9
|
attr_accessor :interfaces
|
12
10
|
attr_accessor :constants
|
@@ -23,7 +21,6 @@ module Expressir
|
|
23
21
|
@id = options[:id]
|
24
22
|
@remarks = options.fetch(:remarks, [])
|
25
23
|
@source = options[:source]
|
26
|
-
@head_source = options[:head_source]
|
27
24
|
|
28
25
|
@version = options[:version]
|
29
26
|
@interfaces = options.fetch(:interfaces, [])
|
data/lib/expressir/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "expressir/express_exp/parser"
|
3
|
+
require "expressir/express_exp/formatter"
|
3
4
|
require "expressir/express_exp/hyperlink_formatter"
|
4
5
|
|
5
6
|
RSpec.describe Expressir::ExpressExp::HyperlinkFormatter do
|
@@ -7,7 +8,10 @@ RSpec.describe Expressir::ExpressExp::HyperlinkFormatter do
|
|
7
8
|
it "formats hyperlink" do
|
8
9
|
repo = Expressir::ExpressExp::Parser.from_file(input_file)
|
9
10
|
|
10
|
-
|
11
|
+
class CustomFormatter < Expressir::ExpressExp::Formatter
|
12
|
+
include Expressir::ExpressExp::HyperlinkFormatter
|
13
|
+
end
|
14
|
+
result = CustomFormatter.format(repo)
|
11
15
|
expected_result = File.read(output_file)
|
12
16
|
|
13
17
|
expect(result).to eq(expected_result)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "expressir/express_exp/parser"
|
3
|
+
require "expressir/express_exp/formatter"
|
3
4
|
require "expressir/express_exp/schema_head_formatter"
|
4
5
|
|
5
6
|
RSpec.describe Expressir::ExpressExp::SchemaHeadFormatter do
|
@@ -7,7 +8,10 @@ RSpec.describe Expressir::ExpressExp::SchemaHeadFormatter do
|
|
7
8
|
it "formats schema head" do
|
8
9
|
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
9
10
|
|
10
|
-
|
11
|
+
class CustomFormatter < Expressir::ExpressExp::Formatter
|
12
|
+
include Expressir::ExpressExp::SchemaHeadFormatter
|
13
|
+
end
|
14
|
+
result = CustomFormatter.format(repo)
|
11
15
|
|
12
16
|
expect(result).to eq(<<~EXP.strip
|
13
17
|
SCHEMA syntax_schema 'version';
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expressir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.16
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -342,7 +342,6 @@ files:
|
|
342
342
|
- spec/expressir/express_exp/formatter/remark_spec.rb
|
343
343
|
- spec/expressir/express_exp/formatter/syntax_spec.rb
|
344
344
|
- spec/expressir/express_exp/hyperlink_formatter_spec.rb
|
345
|
-
- spec/expressir/express_exp/parser/head_source_spec.rb
|
346
345
|
- spec/expressir/express_exp/parser/multiple_spec.rb
|
347
346
|
- spec/expressir/express_exp/parser/remark_spec.rb
|
348
347
|
- spec/expressir/express_exp/parser/source_spec.rb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "expressir/express_exp/parser"
|
3
|
-
|
4
|
-
RSpec.describe Expressir::ExpressExp::Parser do
|
5
|
-
describe ".head_source" do
|
6
|
-
it "contains original head source" do
|
7
|
-
input = File.read(sample_file)
|
8
|
-
repo = Expressir::ExpressExp::Parser.from_file(sample_file)
|
9
|
-
|
10
|
-
repo.schemas[0].tap do |x|
|
11
|
-
start_index = x.source.index("SCHEMA")
|
12
|
-
stop_index = x.source.index(";") + ";".length - 1
|
13
|
-
expected_result = x.source[start_index..stop_index]
|
14
|
-
expect(x.head_source).to eq(expected_result)
|
15
|
-
end
|
16
|
-
|
17
|
-
repo.schemas[1].tap do |x|
|
18
|
-
start_index = x.source.index("SCHEMA")
|
19
|
-
stop_index = x.source.index(";") + ";".length - 1
|
20
|
-
expected_result = x.source[start_index..stop_index]
|
21
|
-
expect(x.head_source).to eq(expected_result)
|
22
|
-
end
|
23
|
-
|
24
|
-
repo.schemas[2].tap do |x|
|
25
|
-
start_index = x.source.index("SCHEMA")
|
26
|
-
stop_index = x.source.index("REFERENCE FROM contract_schema;") + "REFERENCE FROM contract_schema;".length - 1
|
27
|
-
expected_result = x.source[start_index..stop_index]
|
28
|
-
expect(x.head_source).to eq(expected_result)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def sample_file
|
34
|
-
@sample_file ||= Expressir.root_path.join(
|
35
|
-
"original", "examples", "syntax", "source.exp"
|
36
|
-
)
|
37
|
-
end
|
38
|
-
end
|