expressir 0.2.7-x64-mingw32 → 0.2.8-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +10 -5
- data/.gitignore +1 -1
- 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/visitor.rb +13 -11
- data/lib/expressir/model/identifier.rb +2 -1
- data/lib/expressir/model/scope.rb +18 -3
- data/lib/expressir/version.rb +1 -1
- data/original/examples/syntax/syntax.exp +1 -0
- data/spec/expressir/express_exp/find_spec.rb +28 -0
- data/spec/expressir/express_exp/source_spec.rb +32 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a9693930dd06c19eededab31261d9d3de41261b28d8c80edd3e0f8a3a8059da
|
4
|
+
data.tar.gz: d144183e37f61c02b1444436a025291aa5678a9bc9c6675b4872466c0f6075b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d40a36cdf2d7712353ba266468bd324e8fe68132fe51231707467a24e848ca5ce029088ba513ccd37531251219bee3e666dfafb01d2323c650d6930b8c1654a1
|
7
|
+
data.tar.gz: 8e384fed328cb582918a42c12b418db5ecc12ca9dfe9d61ed6f1af8326fee85c1cf8bbce7d2fe6a744a15c63fa5c1afdc45781f24e6d6d4efbc6e1bc28e25435
|
@@ -71,14 +71,19 @@ jobs:
|
|
71
71
|
|
72
72
|
- name: Publish to rubygems.org
|
73
73
|
env:
|
74
|
-
RUBYGEMS_API_KEY: ${{secrets.LUTAML_CI_RUBYGEMS_API_KEY}}
|
74
|
+
RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
|
75
75
|
run: |
|
76
76
|
mkdir -p ~/.gem
|
77
|
-
|
77
|
+
echo "---"
|
78
|
+
cat > ~/.gem/credentials << EOF
|
78
79
|
---
|
79
80
|
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
80
81
|
EOF
|
82
|
+
echo "---"
|
81
83
|
chmod 0600 ~/.gem/credentials
|
82
|
-
|
83
|
-
gem
|
84
|
-
|
84
|
+
echo "---"
|
85
|
+
ls -la ~/.gem
|
86
|
+
echo "---"
|
87
|
+
gem signin --debug
|
88
|
+
echo "---"
|
89
|
+
for gem in pkg/*.gem; do gem push $gem -V; done
|
data/.gitignore
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -58,10 +58,20 @@ module Expressir
|
|
58
58
|
ctx.map{|ctx2| visit(ctx2)}.flatten if ctx
|
59
59
|
end
|
60
60
|
|
61
|
+
def get_tokens(ctx)
|
62
|
+
start_index, stop_index = if ctx.instance_of? ::ExpressParser::SyntaxContext
|
63
|
+
[0, @tokens.size - 1]
|
64
|
+
else
|
65
|
+
[ctx.start.token_index, ctx.stop.token_index]
|
66
|
+
end
|
67
|
+
|
68
|
+
@tokens[start_index..stop_index]
|
69
|
+
end
|
70
|
+
|
61
71
|
def attach_source(ctx, node)
|
62
72
|
if node.class.method_defined? :source
|
63
|
-
|
64
|
-
node.source =
|
73
|
+
source_tokens = get_tokens(ctx).select{|x| x.text != '<EOF>'}
|
74
|
+
node.source = source_tokens.map{|x| x.text}.join('').force_encoding('UTF-8')
|
65
75
|
end
|
66
76
|
end
|
67
77
|
|
@@ -76,15 +86,7 @@ module Expressir
|
|
76
86
|
end
|
77
87
|
|
78
88
|
def attach_remarks(ctx, node)
|
79
|
-
|
80
|
-
start_index, stop_index = if ctx.instance_of? ::ExpressParser::SyntaxContext
|
81
|
-
[0, @tokens.size - 1]
|
82
|
-
else
|
83
|
-
[ctx.start.token_index, ctx.stop.token_index]
|
84
|
-
end
|
85
|
-
# puts [start_index, stop_index, ctx.class].inspect
|
86
|
-
|
87
|
-
remark_tokens = @tokens[start_index..stop_index].select{|x| x.channel == REMARK_CHANNEL}
|
89
|
+
remark_tokens = get_tokens(ctx).select{|x| x.channel == REMARK_CHANNEL}
|
88
90
|
if remark_tokens
|
89
91
|
remark_tokens.each do |remark_token|
|
90
92
|
remark_text = remark_token.text
|
@@ -1,11 +1,26 @@
|
|
1
1
|
module Expressir
|
2
2
|
module Model
|
3
3
|
module Scope
|
4
|
+
attr_accessor :source
|
5
|
+
|
4
6
|
def find(path)
|
5
|
-
path.downcase.split("."
|
6
|
-
|
7
|
-
|
7
|
+
current, rest = path.downcase.split(".", 2)
|
8
|
+
|
9
|
+
# ignore `wr:`, `ip:` part
|
10
|
+
if current.include? ":"
|
11
|
+
_, current = current.split(":", 2)
|
12
|
+
end
|
13
|
+
|
14
|
+
child = children.find{|x| x.id.downcase == current}
|
15
|
+
|
16
|
+
if rest
|
17
|
+
if child.class.method_defined? :find
|
18
|
+
child.find(rest)
|
19
|
+
else
|
20
|
+
nil
|
8
21
|
end
|
22
|
+
else
|
23
|
+
child
|
9
24
|
end
|
10
25
|
end
|
11
26
|
|
data/lib/expressir/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "expressir/express_exp/parser"
|
3
|
+
|
4
|
+
RSpec.describe Expressir::Model::Scope do
|
5
|
+
describe ".find" do
|
6
|
+
it "finds an item" do
|
7
|
+
repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
|
8
|
+
|
9
|
+
schema = repo.find("syntax_schema")
|
10
|
+
expect(schema).to be_instance_of(Expressir::Model::Schema)
|
11
|
+
|
12
|
+
entity = repo.find("syntax_schema.empty_entity")
|
13
|
+
expect(entity).to be_instance_of(Expressir::Model::Entity)
|
14
|
+
|
15
|
+
attribute = repo.find("syntax_schema.attribute_entity.test")
|
16
|
+
expect(attribute).to be_instance_of(Expressir::Model::Attribute)
|
17
|
+
|
18
|
+
where = repo.find("syntax_schema.where_label_entity.wr:WR1")
|
19
|
+
expect(where).to be_instance_of(Expressir::Model::Where)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def sample_file
|
24
|
+
@sample_file ||= Expressir.root_path.join(
|
25
|
+
"original", "examples", "syntax", "syntax.exp"
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "expressir/express_exp/parser"
|
3
|
+
|
4
|
+
RSpec.describe Expressir::Model::Scope do
|
5
|
+
describe ".source" do
|
6
|
+
it "contains original source" do
|
7
|
+
input = File.read(sample_file)
|
8
|
+
repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
|
9
|
+
|
10
|
+
expected_result = input
|
11
|
+
expect(repo.source).to eq(expected_result)
|
12
|
+
|
13
|
+
schema = repo.schemas.first
|
14
|
+
start_index = input.index("SCHEMA")
|
15
|
+
stop_index = input.index("END_SCHEMA;") + "END_SCHEMA;".length - 1
|
16
|
+
expected_result = input[start_index..stop_index]
|
17
|
+
expect(schema.source).to eq(expected_result)
|
18
|
+
|
19
|
+
entity = schema.entities.first
|
20
|
+
start_index = input.index("ENTITY")
|
21
|
+
stop_index = input.index("END_ENTITY;") + "END_ENTITY;".length - 1
|
22
|
+
expected_result = input[start_index..stop_index]
|
23
|
+
expect(entity.source).to eq(expected_result)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def sample_file
|
28
|
+
@sample_file ||= Expressir.root_path.join(
|
29
|
+
"original", "examples", "syntax", "syntax.exp"
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
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.8
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -317,10 +317,12 @@ files:
|
|
317
317
|
- spec/acceptance/version_spec.rb
|
318
318
|
- spec/expressir/express/repository_spec.rb
|
319
319
|
- spec/expressir/express_exp/ap233_spec.rb
|
320
|
+
- spec/expressir/express_exp/find_spec.rb
|
320
321
|
- spec/expressir/express_exp/format_remark_spec.rb
|
321
322
|
- spec/expressir/express_exp/format_syntax_spec.rb
|
322
323
|
- spec/expressir/express_exp/parse_remark_spec.rb
|
323
324
|
- spec/expressir/express_exp/parse_syntax_spec.rb
|
325
|
+
- spec/expressir/express_exp/source_spec.rb
|
324
326
|
- spec/expressir/model/find_spec.rb
|
325
327
|
- spec/expressr_spec.rb
|
326
328
|
- spec/spec_helper.rb
|