disallow referring to root

This commit is contained in:
Alexander Wang 2023-03-02 18:01:51 -08:00
parent 78e6f3fc06
commit d8b1e65386
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE

View file

@ -157,6 +157,11 @@ func (c *compiler) compileLink(refctx *RefContext) {
return
}
if linkIDA[0] == "root" {
c.errorf(refctx.Key.Key, "cannot refer to root in link")
return
}
// If it doesn't start with one of these reserved words, the link is definitely not a board link.
if linkIDA[0] != "layers" && linkIDA[0] != "scenarios" && linkIDA[0] != "steps" && linkIDA[0] != "_" {
return