update
This commit is contained in:
parent
691b45733d
commit
a027564100
2 changed files with 2 additions and 7 deletions
|
|
@ -62,16 +62,12 @@ func (c *compiler) compileSteps(m *Map) {
|
||||||
for i, sf := range steps.Fields {
|
for i, sf := range steps.Fields {
|
||||||
if sf.Map() == nil || sf.Primary() != nil {
|
if sf.Map() == nil || sf.Primary() != nil {
|
||||||
c.errorf(sf.References[0].Context.Key, "invalid step")
|
c.errorf(sf.References[0].Context.Key, "invalid step")
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
var base *Map
|
var base *Map
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
base = m.CopyBase(sf)
|
base = m.CopyBase(sf)
|
||||||
} else {
|
} else {
|
||||||
if steps.Fields[i-1].Map() == nil || steps.Fields[i-1].Primary() != nil {
|
|
||||||
c.errorf(steps.Fields[i-1].References[0].Context.Key, "invalid step")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
base = steps.Fields[i-1].Map().CopyBase(sf)
|
base = steps.Fields[i-1].Map().CopyBase(sf)
|
||||||
}
|
}
|
||||||
OverlayMap(base, sf.Map())
|
OverlayMap(base, sf.Map())
|
||||||
|
|
|
||||||
|
|
@ -433,8 +433,7 @@ scenarios: {
|
||||||
}`)
|
}`)
|
||||||
assert.ErrorString(t, err, `TestCompile/steps/steps_panic.d2:6:3: invalid scenario
|
assert.ErrorString(t, err, `TestCompile/steps/steps_panic.d2:6:3: invalid scenario
|
||||||
TestCompile/steps/steps_panic.d2:7:3: invalid scenario
|
TestCompile/steps/steps_panic.d2:7:3: invalid scenario
|
||||||
TestCompile/steps/steps_panic.d2:2:3: invalid step
|
TestCompile/steps/steps_panic.d2:2:3: invalid step`)
|
||||||
TestCompile/steps/steps_panic.d2:3:3: invalid step`)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue