forked from Jaseci-Labs/jaclang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Jaseci-Labs#245 from Jaseci-Labs/nodes_in_edge_refs
feat: node types in edge ref lists
- Loading branch information
Showing
6 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
walker creator { | ||
can create with `<root> entry; | ||
} | ||
|
||
node node_a { | ||
has val: int; | ||
} | ||
|
||
node node_b { | ||
has val: int; | ||
} | ||
|
||
edge Edge_a { | ||
has value: int = 10; | ||
} | ||
|
||
edge Edge_b { | ||
has value1: int = 20; | ||
} | ||
|
||
edge Edge_c { | ||
has value2: int = 30; | ||
} | ||
|
||
:walker:creator:can:create { | ||
for i=0 to i<2 by i+=1 { | ||
<here> +:Edge_c:value2=30:+> (node_a(val=i + 1)); | ||
visit [-->]; | ||
} | ||
<here> +:Edge_a:value=10:+> (end := node_a(val=i + 10)); | ||
end +:Edge_b:value1=20:+> (last := node_a(val=i + 20)); | ||
for j=0 to j<2 by j+=1 { | ||
last +:Edge_c:value2=40:+> (node_a(val=i + 40)); | ||
last +:Edge_c:value2=40:+> (node_b(val=i + 40)); | ||
} | ||
} | ||
|
||
with entry { | ||
print(<root> spawn creator()); | ||
print(<r>._jac_.gen_dot()); | ||
print([<root>-:Edge_a:->]); | ||
print([<root>-:Edge_c:->]); | ||
print([<root>-:Edge_a:->-:Edge_b:->]); | ||
print([<root>-:Edge_a:->-:Edge_b:->-:Edge_c:->]); | ||
print([<root>-:Edge_a:->-:Edge_b:->-:Edge_c:->(`?node_b)]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters