Skip to content

Table access using scope operator not working (XML) #5

@sigmasoldi3r

Description

@sigmasoldi3r

Hello! I was testing the example from the guide: XML in Basalt, but it does not work straight from the guide.

If you do, in your xml <elem var="${table.value}"> the engine looks up the scope variable as scope["table.value"].

This means that the example:

<frame background="${colors.gray}">
    <label 
        x="2" y="2"
        text="${appTitle}"
    />
</frame>
local scope = {
    appTitle = "My App",
    colors = colors
}

Won't work, instead you have to write:

local scope = {
    appTitle = "My App",
-   colors = colors
+   ["colors.gray"] = colors.gray
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions