change err msg
This commit is contained in:
parent
74e64ca3d0
commit
8b4b4a72c7
5 changed files with 7 additions and 7 deletions
|
|
@ -328,7 +328,7 @@ containers: {
|
||||||
Steps
|
Steps
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/image_children_Steps.d2:4:3: steps is only allowed at a board root`,
|
expErr: `d2/testdata/d2compiler/TestCompile/image_children_Steps.d2:4:3: steps must be declared at a board root scope`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "name-with-dot-underscore",
|
name: "name-with-dot-underscore",
|
||||||
|
|
@ -1746,7 +1746,7 @@ c: {
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/import-classes-boards.d2:10:7: layers is only allowed at a board root`,
|
expErr: `d2/testdata/d2compiler/TestCompile/import-classes-boards.d2:10:7: layers must be declared at a board root scope`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "import_url_link",
|
name: "import_url_link",
|
||||||
|
|
|
||||||
|
|
@ -593,7 +593,7 @@ classes: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
assert.ErrorString(t, err, `TestCompile/classes/nonroot.d2:2:3: classes is only allowed at a board root`)
|
assert.ErrorString(t, err, `TestCompile/classes/nonroot.d2:2:3: classes must be declared at a board root scope`)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -942,11 +942,11 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, create b
|
||||||
}
|
}
|
||||||
|
|
||||||
if headString == "classes" && head.IsUnquoted() && NodeBoardKind(m) == "" {
|
if headString == "classes" && head.IsUnquoted() && NodeBoardKind(m) == "" {
|
||||||
return d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", headString)
|
return d2parser.Errorf(kp.Path[i].Unbox(), "%s must be declared at a board root scope", headString)
|
||||||
}
|
}
|
||||||
|
|
||||||
if findBoardKeyword(head) != -1 && head.IsUnquoted() && NodeBoardKind(m) == "" {
|
if findBoardKeyword(head) != -1 && head.IsUnquoted() && NodeBoardKind(m) == "" {
|
||||||
return d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", headString)
|
return d2parser.Errorf(kp.Path[i].Unbox(), "%s must be declared at a board root scope", headString)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range m.Fields {
|
for _, f := range m.Fields {
|
||||||
|
|
|
||||||
2
testdata/d2compiler/TestCompile/image_children_Steps.exp.json
generated
vendored
2
testdata/d2compiler/TestCompile/image_children_Steps.exp.json
generated
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/image_children_Steps.d2,3:2:115-3:7:120",
|
"range": "d2/testdata/d2compiler/TestCompile/image_children_Steps.d2,3:2:115-3:7:120",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/image_children_Steps.d2:4:3: steps is only allowed at a board root"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/image_children_Steps.d2:4:3: steps must be declared at a board root scope"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
testdata/d2compiler/TestCompile/import-classes-boards.exp.json
generated
vendored
2
testdata/d2compiler/TestCompile/import-classes-boards.exp.json
generated
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/import-classes-boards.d2,9:6:75-9:12:81",
|
"range": "d2/testdata/d2compiler/TestCompile/import-classes-boards.d2,9:6:75-9:12:81",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/import-classes-boards.d2:10:7: layers is only allowed at a board root"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/import-classes-boards.d2:10:7: layers must be declared at a board root scope"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue