expressir 0.2.8-x86-linux → 0.2.9-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +1 -7
  3. data/expressir.gemspec +2 -2
  4. data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
  5. data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
  6. data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
  7. data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
  8. data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
  9. data/lib/expressir/express_exp/formatter.rb +2 -6
  10. data/lib/expressir/express_exp/parser.rb +14 -1
  11. data/lib/expressir/express_exp/visitor.rb +79 -43
  12. data/lib/expressir/model.rb +1 -0
  13. data/lib/expressir/model/entity.rb +3 -0
  14. data/lib/expressir/model/informal_proposition.rb +11 -0
  15. data/lib/expressir/model/rule.rb +3 -0
  16. data/lib/expressir/model/schema.rb +2 -0
  17. data/lib/expressir/model/scope.rb +43 -9
  18. data/lib/expressir/model/type.rb +8 -0
  19. data/lib/expressir/version.rb +1 -1
  20. data/original/examples/syntax/remark.exp +63 -20
  21. data/original/examples/syntax/remark_formatted.exp +62 -19
  22. data/original/examples/syntax/source.exp +16 -0
  23. data/original/examples/syntax/syntax.exp +4 -1
  24. data/original/examples/syntax/syntax_formatted.exp +9 -0
  25. data/spec/expressir/express_exp/head_source_spec.rb +41 -0
  26. data/spec/expressir/express_exp/parse_multiple_spec.rb +32 -0
  27. data/spec/expressir/express_exp/parse_remark_spec.rb +115 -50
  28. data/spec/expressir/express_exp/parse_syntax_spec.rb +40 -0
  29. data/spec/expressir/express_exp/source_spec.rb +1 -1
  30. data/spec/expressir/model/find_spec.rb +19 -6
  31. metadata +8 -5
  32. data/spec/expressir/express_exp/find_spec.rb +0 -28
@@ -26,7 +26,7 @@ RSpec.describe Expressir::Model::Scope do
26
26
 
27
27
  def sample_file
28
28
  @sample_file ||= Expressir.root_path.join(
29
- "original", "examples", "syntax", "syntax.exp"
29
+ "original", "examples", "syntax", "source.exp"
30
30
  )
31
31
  end
32
32
  end
@@ -10,13 +10,16 @@ RSpec.describe Expressir::Model do
10
10
  expect(repo.find('remark_schema')).to be_instance_of(Expressir::Model::Schema)
11
11
  expect(repo.find('remark_schema.remark_constant')).to be_instance_of(Expressir::Model::Constant)
12
12
  expect(repo.find('remark_schema.remark_type')).to be_instance_of(Expressir::Model::Type)
13
+ expect(repo.find('remark_schema.remark_type.WR1')).to be_instance_of(Expressir::Model::Where)
14
+ expect(repo.find('remark_schema.remark_type.wr:WR1')).to be_instance_of(Expressir::Model::Where)
13
15
  expect(repo.find('remark_schema.remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
14
16
  expect(repo.find('remark_schema.remark_entity')).to be_instance_of(Expressir::Model::Entity)
15
17
  expect(repo.find('remark_schema.remark_entity.remark_attribute')).to be_instance_of(Expressir::Model::Attribute)
16
18
  expect(repo.find('remark_schema.remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
17
19
  expect(repo.find('remark_schema.remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
18
20
  expect(repo.find('remark_schema.remark_entity.remark_unique')).to be_instance_of(Expressir::Model::Unique)
19
- expect(repo.find('remark_schema.remark_entity.remark_where')).to be_instance_of(Expressir::Model::Where)
21
+ expect(repo.find('remark_schema.remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
22
+ expect(repo.find('remark_schema.remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
20
23
  expect(repo.find('remark_schema.remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
21
24
  expect(repo.find('remark_schema.remark_function')).to be_instance_of(Expressir::Model::Function)
22
25
  expect(repo.find('remark_schema.remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
@@ -35,7 +38,8 @@ RSpec.describe Expressir::Model do
35
38
  expect(repo.find('remark_schema.remark_rule.remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
36
39
  expect(repo.find('remark_schema.remark_rule.remark_constant')).to be_instance_of(Expressir::Model::Constant)
37
40
  expect(repo.find('remark_schema.remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
38
- expect(repo.find('remark_schema.remark_rule.remark_where')).to be_instance_of(Expressir::Model::Where)
41
+ expect(repo.find('remark_schema.remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
42
+ expect(repo.find('remark_schema.remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
39
43
 
40
44
  # schema scope
41
45
  schema = repo.schemas.first
@@ -47,7 +51,8 @@ RSpec.describe Expressir::Model do
47
51
  expect(schema.find('remark_entity.remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
48
52
  expect(schema.find('remark_entity.remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
49
53
  expect(schema.find('remark_entity.remark_unique')).to be_instance_of(Expressir::Model::Unique)
50
- expect(schema.find('remark_entity.remark_where')).to be_instance_of(Expressir::Model::Where)
54
+ expect(schema.find('remark_entity.WR1')).to be_instance_of(Expressir::Model::Where)
55
+ expect(schema.find('remark_entity.wr:WR1')).to be_instance_of(Expressir::Model::Where)
51
56
  expect(schema.find('remark_subtype_constraint')).to be_instance_of(Expressir::Model::SubtypeConstraint)
52
57
  expect(schema.find('remark_function')).to be_instance_of(Expressir::Model::Function)
53
58
  expect(schema.find('remark_function.remark_parameter')).to be_instance_of(Expressir::Model::Parameter)
@@ -66,7 +71,13 @@ RSpec.describe Expressir::Model do
66
71
  expect(schema.find('remark_rule.remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
67
72
  expect(schema.find('remark_rule.remark_constant')).to be_instance_of(Expressir::Model::Constant)
68
73
  expect(schema.find('remark_rule.remark_variable')).to be_instance_of(Expressir::Model::Variable)
69
- expect(schema.find('remark_rule.remark_where')).to be_instance_of(Expressir::Model::Where)
74
+ expect(schema.find('remark_rule.WR1')).to be_instance_of(Expressir::Model::Where)
75
+ expect(schema.find('remark_rule.wr:WR1')).to be_instance_of(Expressir::Model::Where)
76
+
77
+ # type scope
78
+ type = schema.types.first
79
+ expect(type.find('WR1')).to be_instance_of(Expressir::Model::Where)
80
+ expect(type.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
70
81
 
71
82
  # entity scope
72
83
  entity = schema.entities.first
@@ -74,7 +85,8 @@ RSpec.describe Expressir::Model do
74
85
  expect(entity.find('remark_derived_attribute')).to be_instance_of(Expressir::Model::Attribute)
75
86
  expect(entity.find('remark_inverse_attribute')).to be_instance_of(Expressir::Model::Attribute)
76
87
  expect(entity.find('remark_unique')).to be_instance_of(Expressir::Model::Unique)
77
- expect(entity.find('remark_where')).to be_instance_of(Expressir::Model::Where)
88
+ expect(entity.find('WR1')).to be_instance_of(Expressir::Model::Where)
89
+ expect(entity.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
78
90
 
79
91
  # function scope
80
92
  function = schema.functions.first
@@ -98,7 +110,8 @@ RSpec.describe Expressir::Model do
98
110
  expect(rule.find('remark_enumeration_item')).to be_instance_of(Expressir::Model::EnumerationItem)
99
111
  expect(rule.find('remark_constant')).to be_instance_of(Expressir::Model::Constant)
100
112
  expect(rule.find('remark_variable')).to be_instance_of(Expressir::Model::Variable)
101
- expect(rule.find('remark_where')).to be_instance_of(Expressir::Model::Where)
113
+ expect(rule.find('WR1')).to be_instance_of(Expressir::Model::Where)
114
+ expect(rule.find('wr:WR1')).to be_instance_of(Expressir::Model::Where)
102
115
  end
103
116
  end
104
117
 
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.8
4
+ version: 0.2.9
5
5
  platform: x86-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-23 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '10.0'
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '10.0'
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake-compiler
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +223,7 @@ files:
223
223
  - lib/expressir/model/expressions/unary_expression.rb
224
224
  - lib/expressir/model/function.rb
225
225
  - lib/expressir/model/identifier.rb
226
+ - lib/expressir/model/informal_proposition.rb
226
227
  - lib/expressir/model/interface.rb
227
228
  - lib/expressir/model/literals/binary.rb
228
229
  - lib/expressir/model/literals/integer.rb
@@ -303,6 +304,7 @@ files:
303
304
  - original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml
304
305
  - original/examples/syntax/remark.exp
305
306
  - original/examples/syntax/remark_formatted.exp
307
+ - original/examples/syntax/source.exp
306
308
  - original/examples/syntax/syntax.exp
307
309
  - original/examples/syntax/syntax_formatted.exp
308
310
  - original/exp2ruby.rb
@@ -317,9 +319,10 @@ files:
317
319
  - spec/acceptance/version_spec.rb
318
320
  - spec/expressir/express/repository_spec.rb
319
321
  - spec/expressir/express_exp/ap233_spec.rb
320
- - spec/expressir/express_exp/find_spec.rb
321
322
  - spec/expressir/express_exp/format_remark_spec.rb
322
323
  - spec/expressir/express_exp/format_syntax_spec.rb
324
+ - spec/expressir/express_exp/head_source_spec.rb
325
+ - spec/expressir/express_exp/parse_multiple_spec.rb
323
326
  - spec/expressir/express_exp/parse_remark_spec.rb
324
327
  - spec/expressir/express_exp/parse_syntax_spec.rb
325
328
  - spec/expressir/express_exp/source_spec.rb
@@ -1,28 +0,0 @@
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