expressir 2.4.36-arm-linux → 2.4.37-arm-linux
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/expressir/mapping/refpath.rb +65 -4
- data/lib/expressir/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: 338318df9cdcf3b183a219e8a46e52dbbe16af84ad476f9897eb4934b56079a8
|
|
4
|
+
data.tar.gz: 8e4209a9594213d74dcac93943d120e29254548d3b3e9c4d448af2bc9d7ea203
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3a92a528498b5f2e44f6d36fb791c265e4d322ad5c99c59a9203bf6cad43d73070b795d196c4cd48cbf19dfd2b155e94238294117c08242c5fa5f9fc3875810
|
|
7
|
+
data.tar.gz: a692014272ade39551293efde4b6af3bde833406243c27531e70f13e933c43ec566141439560f9ecff3a3c3a9589d84e79f95ad8aee8511b88582f5ce2e63a11
|
|
@@ -24,10 +24,16 @@ module Expressir
|
|
|
24
24
|
# is referenced)
|
|
25
25
|
# index := "[" ("i" | DIGITS) "]"
|
|
26
26
|
# constraint := ["!"] "{" NAME [NAME "."] "=" STRING "}"
|
|
27
|
+
# supertype := "||" NAME "||" (§5 supertype entity marker)
|
|
28
|
+
# tree := "*" NAME "*" (§5 relationship tree marker)
|
|
27
29
|
# MARKER := "{" | "}" | "[" | "]" | "(" | ")" | ":" | "|" | "!"
|
|
28
30
|
# | "," | "/" | "*" | "<" | ">" (grouping/annotation;
|
|
29
31
|
# never breaks a
|
|
30
|
-
# pending link
|
|
32
|
+
# pending link; the §5
|
|
33
|
+
# required-path marker
|
|
34
|
+
# "<path>" is transparent
|
|
35
|
+
# — its contents validate
|
|
36
|
+
# in the running context)
|
|
31
37
|
#
|
|
32
38
|
# Validation (ELF 5006 §8): a running path context tracks the
|
|
33
39
|
# entity a path is "at"; each step must connect to it, attribute
|
|
@@ -104,7 +110,7 @@ module Expressir
|
|
|
104
110
|
EXPRESS_LINK_PATH = /\A<<express:([^,>]+)(?:,[^>]+)?>>\z/
|
|
105
111
|
private_constant :EXPRESS_LINK_PATH
|
|
106
112
|
|
|
107
|
-
TOKEN = /<<express:[^,>]+(?:,[^>]+)
|
|
113
|
+
TOKEN = /<<express:[^,>]+(?:,[^>]+)?>>|->|<-|<=|=>|\*>|<\*|\|\||!?\{|[{}\[\]()=:|!,*\/<>]|'(?:''|[^'])*'|\w+(?:\.\w+)?/
|
|
108
114
|
MARKERS = ["{", "}", "[", "]", "(", ")", ":", "|", "!", ",", "/",
|
|
109
115
|
"*", "<", ">", "MAPPING_OF", "!{"].freeze
|
|
110
116
|
LINKS = ["->", "<-", "<=", "=>", "*>", "<*"].freeze
|
|
@@ -140,13 +146,19 @@ module Expressir
|
|
|
140
146
|
errors = []
|
|
141
147
|
pending_link = nil
|
|
142
148
|
pending_type_assign = false
|
|
143
|
-
false
|
|
144
149
|
i = 0
|
|
145
150
|
while i < tokens.length
|
|
146
151
|
token = tokens[i]
|
|
147
152
|
case token
|
|
153
|
+
when "||"
|
|
154
|
+
name_token = tokens[i + 1]
|
|
155
|
+
if name_token&.match?(/\A\w+\z/) && tokens[i + 2] == "||"
|
|
156
|
+
steps << Step.new(operator: "||", name: name_token)
|
|
157
|
+
i += 2
|
|
158
|
+
else
|
|
159
|
+
errors << "supertype marker '||' without an entity name"
|
|
160
|
+
end
|
|
148
161
|
when "!{"
|
|
149
|
-
true
|
|
150
162
|
step, consumed = parse_constraint(tokens[i..], negated: true)
|
|
151
163
|
steps << step
|
|
152
164
|
i += consumed
|
|
@@ -182,6 +194,14 @@ module Expressir
|
|
|
182
194
|
else
|
|
183
195
|
steps << Step.new(operator: "[")
|
|
184
196
|
end
|
|
197
|
+
when "*"
|
|
198
|
+
name_token = tokens[i + 1]
|
|
199
|
+
if name_token&.match?(/\A\w+\z/) && tokens[i + 2] == "*"
|
|
200
|
+
steps << Step.new(operator: "*", name: name_token)
|
|
201
|
+
i += 2
|
|
202
|
+
else
|
|
203
|
+
steps << Step.new(operator: token)
|
|
204
|
+
end
|
|
185
205
|
when *MARKERS
|
|
186
206
|
steps << Step.new(operator: token)
|
|
187
207
|
when /\A<<express:/
|
|
@@ -302,6 +322,14 @@ module Expressir
|
|
|
302
322
|
when "*>", "<*"
|
|
303
323
|
issues.concat(select_extension_issues(step, pos, ctx, by_name))
|
|
304
324
|
ctx = step.name&.safe_downcase
|
|
325
|
+
when "||"
|
|
326
|
+
issues.concat(supertype_marker_issues(step, pos, ctx, by_name))
|
|
327
|
+
if step.name
|
|
328
|
+
seen[step.name.safe_downcase] = true
|
|
329
|
+
ctx = step.name.safe_downcase
|
|
330
|
+
end
|
|
331
|
+
when "*"
|
|
332
|
+
issues.concat(tree_marker_issues(step, pos, by_name))
|
|
305
333
|
else
|
|
306
334
|
issues.concat(check_step(step, pos, ctx, last_qualified, by_name))
|
|
307
335
|
if step.name
|
|
@@ -495,6 +523,39 @@ module Expressir
|
|
|
495
523
|
end
|
|
496
524
|
end
|
|
497
525
|
|
|
526
|
+
# ELF 5006 §5 supertype entity marker: `||supertype||` names an
|
|
527
|
+
# entity that must exist and, when the path has a running
|
|
528
|
+
# context, be a supertype of (or equal to) that context entity.
|
|
529
|
+
def supertype_marker_issues(step, pos, ctx, by_name)
|
|
530
|
+
issues = []
|
|
531
|
+
entity = step.name
|
|
532
|
+
check_exists(issues, pos, entity, by_name)
|
|
533
|
+
return issues if entity.nil?
|
|
534
|
+
|
|
535
|
+
decl = by_name[entity.safe_downcase]&.last
|
|
536
|
+
return issues unless decl.is_a?(Model::Declarations::Entity)
|
|
537
|
+
|
|
538
|
+
context_decl = ctx && by_name[ctx]&.last
|
|
539
|
+
if context_decl.is_a?(Model::Declarations::Entity) &&
|
|
540
|
+
!entity_reaches?(context_decl, entity.safe_downcase, by_name,
|
|
541
|
+
{}.compare_by_identity)
|
|
542
|
+
issues << Issue.new(step: pos,
|
|
543
|
+
message: "'#{entity}' is not a supertype of " \
|
|
544
|
+
"'#{ctx}'")
|
|
545
|
+
end
|
|
546
|
+
issues
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# ELF 5006 §5 relationship tree marker: `*relationship*` names an
|
|
550
|
+
# entity whose instances may assemble into a tree; the path
|
|
551
|
+
# between it and the related entities is implied, so only the
|
|
552
|
+
# entity's existence is checkable.
|
|
553
|
+
def tree_marker_issues(step, pos, by_name)
|
|
554
|
+
issues = []
|
|
555
|
+
check_exists(issues, pos, step.name, by_name)
|
|
556
|
+
issues
|
|
557
|
+
end
|
|
558
|
+
|
|
498
559
|
# ELF 5006 §8 navigation validation with a running context: the
|
|
499
560
|
# attribute must exist on the context entity, and its type must
|
|
500
561
|
# be able to reference the step's target entity.
|
data/lib/expressir/version.rb
CHANGED