diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 0f5032a82c..16fd489445 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -9,6 +9,8 @@ #### Improvements 🧹 +- labels on scenario/step boards can be set with primary value (like layers) [#2579](https://github.com/terrastruct/d2/pull/2579) + #### Bugfixes ⛑️ - actors in sequence diagrams with labels and icons together no longer overlap, position keywords now work too [#2548](https://github.com/terrastruct/d2/pull/2548) diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 8fe5909e58..a593f67fe0 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -4210,9 +4210,16 @@ layers: { RJ } } + +scenarios: { + x: b { + k + } +} `, "") assert.Equal(t, "one", g.Layers[0].Root.Label.Value) assert.Equal(t, "two", g.Layers[1].Root.Label.Value) + assert.Equal(t, "b", g.Scenarios[0].Root.Label.Value) }, }, { diff --git a/d2ir/compile.go b/d2ir/compile.go index 23a74929eb..9cda79abee 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -432,10 +432,11 @@ func (c *compiler) resolveSubstitution(vars *Map, node Node, substitution *d2ast } func (c *compiler) overlay(base *Map, f *Field) { - if f.Map() == nil || f.Primary() != nil { + if f.Map() == nil { c.errorf(f.References[0].Context_.Key, "invalid %s", NodeBoardKind(f)) return } + base = base.CopyBase(f) // Certain fields should never carry forward. // If you give your scenario a label, you don't want all steps in a scenario to be labeled the same. diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index da3a74aaa6..787a747e0b 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -496,21 +496,6 @@ steps: { assertQuery(t, m, 0, 0, nil, "steps.nuclear.quiche") }, }, - { - name: "steps_panic", - run: func(t testing.TB) { - _, err := compile(t, `steps: { - shape: sql_table - id: int {constraint: primary_key} -} -scenarios: { - shape: sql_table - hey: int {constraint: primary_key} -}`) - assert.ErrorString(t, err, `TestCompile/steps/steps_panic.d2:3:3: invalid step -TestCompile/steps/steps_panic.d2:7:3: invalid scenario`) - }, - }, { name: "recursive", run: func(t testing.TB) { diff --git a/testdata/d2compiler/TestCompile2/boards/board-label-primary.exp.json b/testdata/d2compiler/TestCompile2/boards/board-label-primary.exp.json index cc6d74f2ec..638937b7a1 100644 --- a/testdata/d2compiler/TestCompile2/boards/board-label-primary.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/board-label-primary.exp.json @@ -3,7 +3,7 @@ "name": "", "isFolderOnly": false, "ast": { - "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-10:0:70", + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-16:0:105", "nodes": [ { "map_key": { @@ -203,6 +203,97 @@ } } } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,11:0:71-15:1:104", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,11:0:71-11:9:80", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,11:0:71-11:9:80", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,11:11:82-15:1:104", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,12:2:86-14:3:102", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,12:2:86-12:3:87", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,12:2:86-12:3:87", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,12:5:89-12:6:90", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,12:7:91-14:3:102", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "value": [ + { + "string": "k", + "raw_string": "k" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + } + } + } } ] }, @@ -523,6 +614,182 @@ } ] } + ], + "scenarios": [ + { + "name": "x", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-0:2:2", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "value": [ + { + "string": "k", + "raw_string": "k" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "attributes": { + "label": { + "value": "b" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "iconStyle": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "hi", + "id_val": "hi", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,0:0:0-0:2:2", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hi" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "iconStyle": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "k", + "id_val": "k", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/boards/board-label-primary.d2,13:4:97-13:5:98", + "value": [ + { + "string": "k", + "raw_string": "k" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "k" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "iconStyle": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ] + } ] }, "err": null diff --git a/testdata/d2ir/TestCompile/steps/steps_panic.exp.json b/testdata/d2ir/TestCompile/steps/steps_panic.exp.json new file mode 100644 index 0000000000..52d0a31792 --- /dev/null +++ b/testdata/d2ir/TestCompile/steps/steps_panic.exp.json @@ -0,0 +1,1061 @@ +{ + "fields": [ + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + }, + "composite": { + "fields": [ + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,5:9:88-5:18:97", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:18:97", + "key": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,5:9:88-5:18:97", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + }, + "composite": { + "fields": [ + { + "name": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "label" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,6:7:105-6:10:108", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "references": [ + { + "string": null, + "key_path": null, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:36:134", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,6:24:122-6:35:133", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:35:133", + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:24:122-6:35:133", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:36:134", + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:7:105-6:10:108", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,6:11:109-6:36:134", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:35:133", + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:24:122-6:35:133", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-7:1:136", + "key": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,4:0:66-4:9:75", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,4:11:77-7:1:136", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:18:97", + "key": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,5:2:81-5:7:86", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,5:9:88-5:18:97", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:36:134", + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:2:100-6:5:103", + "value": [ + { + "string": "hey", + "raw_string": "hey" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:7:105-6:10:108", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,6:11:109-6:36:134", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:35:133", + "key": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:12:110-6:22:120", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,6:24:122-6:35:133", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + }, + "composite": { + "fields": [ + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,1:9:18-1:18:27", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:18:27", + "key": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,1:9:18-1:18:27", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + }, + "composite": { + "fields": [ + { + "name": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "label" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,2:6:34-2:9:37", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "references": [ + { + "string": null, + "key_path": null, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:35:63", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + }, + "primary": { + "value": { + "range": "TestCompile/steps/steps_panic.d2,2:23:51-2:34:62", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:34:62", + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:23:51-2:34:62", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:35:63", + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:6:34-2:9:37", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,2:10:38-2:35:63", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:34:62", + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:23:51-2:34:62", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-3:1:65", + "key": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,0:7:7-3:1:65", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:18:27", + "key": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,1:2:11-1:7:16", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,1:9:18-1:18:27", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:35:63", + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:2:30-2:4:32", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:6:34-2:9:37", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "TestCompile/steps/steps_panic.d2,2:10:38-2:35:63", + "nodes": [ + { + "map_key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:34:62", + "key": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:11:39-2:21:49", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/steps/steps_panic.d2,2:23:51-2:34:62", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null +}