Merge pull request #370 from alixander/sequence-scoping

Sequence scoping
This commit is contained in:
Alexander Wang 2022-12-05 20:52:06 -08:00 committed by GitHub
commit c549556c04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1934 additions and 430 deletions

View file

@ -1553,13 +1553,45 @@ dst.id <-> src.dst_id
text: `x: {
shape: sequence_diagram
a
a
}
b -> x.a
`,
expErr: `d2/testdata/d2compiler/TestCompile/leaky_sequence.d2:5:1: connections within sequence diagrams can connect only to other objects within the same sequence diagram
`,
},
{
name: "sequence_scoping",
text: `x: {
shape: sequence_diagram
a;b
group: {
a -> b
a.t1 -> b.t1
b.t1.t2 -> b.t1
}
}
`,
assertions: func(t *testing.T, g *d2graph.Graph) {
tassert.Equal(t, 7, len(g.Objects))
tassert.Equal(t, 3, len(g.Objects[0].ChildrenArray))
},
},
{
name: "sequence_grouped_note",
text: `shape: sequence_diagram
a;d
choo: {
d."this note"
}
`,
assertions: func(t *testing.T, g *d2graph.Graph) {
tassert.Equal(t, 4, len(g.Objects))
tassert.Equal(t, 3, len(g.Root.ChildrenArray))
},
},
{
name: "root_direction",

View file

@ -525,6 +525,22 @@ func (obj *Object) HasEdge(mk *d2ast.Key) (*Edge, bool) {
}
func ResolveUnderscoreKey(ida []string, obj *Object) (resolvedObj *Object, resolvedIDA []string, _ error) {
if len(ida) > 0 && !obj.IsSequenceDiagram() {
objSD := obj.OuterSequenceDiagram()
if objSD != nil {
referencesActor := false
for _, c := range objSD.ChildrenArray {
if c.ID == ida[0] {
referencesActor = true
break
}
}
if referencesActor {
obj = objSD
}
}
}
resolvedObj = obj
resolvedIDA = ida

View file

@ -1363,25 +1363,25 @@ d."The earth is like a tiny grain of sand, only much, much heavier"
a;b;c;d
a -> b
ggg: {
_.a -> _.b: lala
a -> b: lala
}
group 1: {
_.b -> _.c
_.c -> _.b: ey
b -> c
c -> b: ey
nested guy: {
_._.c -> _._.b: okay
c -> b: okay
}
_.b.t1 -> _.c.t1
_.b.t1.t2 -> _.c.t1
_.c.t1 -> _.b.t1
b.t1 -> c.t1
b.t1.t2 -> c.t1
c.t1 -> b.t1
}
group b: {
_.b -> _.c
_.c."what would arnold say"
_.c -> _.b: okay
b -> c
c."what would arnold say"
c -> b: okay
}
choo: {
_.d."this note"
d."this note"
}
`,
},
@ -1389,17 +1389,19 @@ choo: {
name: "sequence_diagram_nested_groups",
script: `shape: sequence_diagram
a; b; c
this is a message group: {
_.a -> _.b
a -> b
and this is a nested message group: {
_._.a -> _._.b
a -> b
what about more nesting: {
_._._.a -> _._._.b
a -> b
crazy town: {
_._._._.a."a note"
_._._._.a -> _._._._.b
a."a note"
a -> b
whoa: {
_._._._._.a -> _._._._._.b
a -> b
}
}
}
@ -1408,16 +1410,16 @@ this is a message group: {
alt: {
case 1: {
_._.b -> _._.c
b -> c
}
case 2: {
_._.b -> _._.c
b -> c
}
case 3: {
_._.b -> _._.c
b -> c
}
case 4: {
_._.b -> _._.c
b -> c
}
}
@ -1431,7 +1433,7 @@ c: "just an actor"
script: `How this is rendered: {
shape: sequence_diagram
CLI; d2ast; d2compiler; d2layout; d2exporter; d2themes; d2renderer
CLI; d2ast; d2compiler; d2layout; d2exporter; d2themes; d2renderer; d2sequencelayout; d2dagrelayout
CLI -> d2ast: "'How this is rendered: {...}'"
d2ast -> CLI: tokenized AST
@ -1441,7 +1443,7 @@ c: "just an actor"
CLI -> d2layout.layout: run layout engines
d2layout.layout -> d2sequencelayout: run engine on shape: sequence_diagram, temporarily remove
only if root is not sequence: {
_.d2layout.layout -> _.d2dagrelayout: run core engine on rest
d2layout.layout -> d2dagrelayout: run core engine on rest
}
d2layout.layout <- d2sequencelayout: add back in sequence diagrams
d2layout -> CLI: diagram with correct positions and dimensions

View file

@ -1,6 +1,126 @@
{
"name": "",
"shapes": [
{
"id": "a",
"type": "",
"pos": {
"x": 24,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "b",
"type": "",
"pos": {
"x": 337,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "c",
"type": "",
"pos": {
"x": 629,
"y": 74
},
"width": 190,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "just an actor",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 90,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "this is a message group",
"type": "",
@ -157,46 +277,6 @@
"zIndex": 3,
"level": 4
},
{
"id": "a",
"type": "",
"pos": {
"x": 24,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "a.a note",
"type": "rectangle",
@ -471,46 +551,6 @@
"zIndex": 3,
"level": 2
},
{
"id": "b",
"type": "",
"pos": {
"x": 337,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "b.note",
"type": "rectangle",
@ -590,46 +630,6 @@
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 5,
"level": 2
},
{
"id": "c",
"type": "",
"pos": {
"x": 629,
"y": 74
},
"width": 190,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "just an actor",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 90,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
}
],
"connections": [

View file

@ -1,6 +1,126 @@
{
"name": "",
"shapes": [
{
"id": "a",
"type": "",
"pos": {
"x": 24,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "b",
"type": "",
"pos": {
"x": 337,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "c",
"type": "",
"pos": {
"x": 629,
"y": 74
},
"width": 190,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "just an actor",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 90,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "this is a message group",
"type": "",
@ -157,46 +277,6 @@
"zIndex": 3,
"level": 4
},
{
"id": "a",
"type": "",
"pos": {
"x": 24,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "a",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 12,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "a.a note",
"type": "rectangle",
@ -471,46 +551,6 @@
"zIndex": 3,
"level": 2
},
{
"id": "b",
"type": "",
"pos": {
"x": 337,
"y": 74
},
"width": 150,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "b",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 13,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "b.note",
"type": "rectangle",
@ -590,46 +630,6 @@
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 5,
"level": 2
},
{
"id": "c",
"type": "",
"pos": {
"x": 629,
"y": 74
},
"width": 190,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "just an actor",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 90,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
}
],
"connections": [

View file

@ -321,6 +321,86 @@
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2sequencelayout",
"type": "",
"pos": {
"x": 1740,
"y": 110
},
"width": 229,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2sequencelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 129,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2dagrelayout",
"type": "",
"pos": {
"x": 2019,
"y": 110
},
"width": 204,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2dagrelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 104,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2compiler.measurements also take place",
"type": "rectangle",
@ -439,86 +519,6 @@
"zIndex": 2,
"level": 3
},
{
"id": "How this is rendered.d2sequencelayout",
"type": "",
"pos": {
"x": 1740,
"y": 110
},
"width": 229,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2sequencelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 129,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2dagrelayout",
"type": "",
"pos": {
"x": 2019,
"y": 110
},
"width": 204,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2dagrelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 104,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2exporter.export",
"type": "rectangle",

View file

@ -321,6 +321,86 @@
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2sequencelayout",
"type": "",
"pos": {
"x": 1752,
"y": 122
},
"width": 229,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2sequencelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 129,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2dagrelayout",
"type": "",
"pos": {
"x": 2031,
"y": 122
},
"width": 204,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2dagrelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 104,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2compiler.measurements also take place",
"type": "rectangle",
@ -439,86 +519,6 @@
"zIndex": 2,
"level": 3
},
{
"id": "How this is rendered.d2sequencelayout",
"type": "",
"pos": {
"x": 1752,
"y": 122
},
"width": 229,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2sequencelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 129,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2dagrelayout",
"type": "",
"pos": {
"x": 2031,
"y": 122
},
"width": 204,
"height": 126,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "#EDF0FD",
"stroke": "#0D32B2",
"shadow": false,
"3d": false,
"multiple": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "d2dagrelayout",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "#0A0F25",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 104,
"labelHeight": 26,
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 2
},
{
"id": "How this is rendered.d2exporter.export",
"type": "rectangle",

View file

@ -75,15 +75,15 @@ ninety nine: {
b;a;c
b -> c
this is a message group: {
_.a -> _.b
a -> b
and this is a nested message group: {
_._.a -> _._.b
a -> b
what about more nesting: {
_._._.a -> _._._.b
a -> b
yo: {
_._._._.a -> _._._._.b
a -> b
yo: {
_._._._._.a -> _._._._._.b
a -> b
}
}
}

View file

@ -4,7 +4,7 @@
"ioerr": null,
"errs": [
{
"range": "d2/testdata/d2compiler/TestCompile/leaky_sequence.d2,4:0:36-4:8:44",
"range": "d2/testdata/d2compiler/TestCompile/leaky_sequence.d2,4:0:37-4:8:45",
"errmsg": "d2/testdata/d2compiler/TestCompile/leaky_sequence.d2:5:1: connections within sequence diagrams can connect only to other objects within the same sequence diagram"
}
]

View file

@ -0,0 +1,395 @@
{
"graph": {
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:0:0-5:0:54",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:0:0-0:23:23",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:0:0-0:5:5",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:0:0-0:5:5",
"value": [
{
"string": "shape",
"raw_string": "shape"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:7:7-0:23:23",
"value": [
{
"string": "sequence_diagram",
"raw_string": "sequence_diagram"
}
]
}
}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:0:24-1:1:25",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:0:24-1:1:25",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:0:24-1:1:25",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
}
]
},
"primary": {},
"value": {}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:2:26-1:3:27",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:2:26-1:3:27",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:2:26-1:3:27",
"value": [
{
"string": "d",
"raw_string": "d"
}
]
}
}
]
},
"primary": {},
"value": {}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:0:28-4:1:53",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:0:28-2:4:32",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:0:28-2:4:32",
"value": [
{
"string": "choo",
"raw_string": "choo"
}
]
}
}
]
},
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:6:34-4:0:52",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:15:51",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:15:51",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:3:39",
"value": [
{
"string": "d",
"raw_string": "d"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:4:40-3:15:51",
"value": [
{
"string": "this note",
"raw_string": "this note"
}
]
}
}
]
},
"primary": {},
"value": {}
}
}
]
}
}
}
}
]
},
"root": {
"id": "",
"id_val": "",
"label_dimensions": {
"width": 0,
"height": 0
},
"attributes": {
"label": {
"value": ""
},
"style": {},
"near_key": null,
"shape": {
"value": "sequence_diagram"
},
"direction": {
"value": ""
}
},
"zIndex": 0
},
"edges": null,
"objects": [
{
"id": "a",
"id_val": "a",
"label_dimensions": {
"width": 0,
"height": 0
},
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:0:24-1:1:25",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:0:24-1:1:25",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "a"
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
}
},
"zIndex": 0
},
{
"id": "d",
"id_val": "d",
"label_dimensions": {
"width": 0,
"height": 0
},
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:2:26-1:3:27",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,1:2:26-1:3:27",
"value": [
{
"string": "d",
"raw_string": "d"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:15:51",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:3:39",
"value": [
{
"string": "d",
"raw_string": "d"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:4:40-3:15:51",
"value": [
{
"string": "this note",
"raw_string": "this note"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "d"
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
}
},
"zIndex": 0
},
{
"id": "choo",
"id_val": "choo",
"label_dimensions": {
"width": 0,
"height": 0
},
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:0:28-2:4:32",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,2:0:28-2:4:32",
"value": [
{
"string": "choo",
"raw_string": "choo"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "choo"
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
}
},
"zIndex": 0
},
{
"id": "this note",
"id_val": "this note",
"label_dimensions": {
"width": 0,
"height": 0
},
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:15:51",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:2:38-3:3:39",
"value": [
{
"string": "d",
"raw_string": "d"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,3:4:40-3:15:51",
"value": [
{
"string": "this note",
"raw_string": "this note"
}
]
}
}
]
},
"key_path_index": 1,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "this note"
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
}
},
"zIndex": 0
}
]
},
"err": null
}

1059
testdata/d2compiler/TestCompile/sequence_scoping.exp.json generated vendored Normal file

File diff suppressed because it is too large Load diff