Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

When returning a string from a conditional check Parser cuts averything after a "-" #77

@Humberd

Description

@Humberd

It should return vis-blue when selected locale is the same as in the list

<:each value="{locales}">
    <table growx="true"
           maxwidth="500"
           onclick="selectLocale"
           id="{value}"
           row="true">
        <label align="left"
               growx="true"
               color="{? $getCurrentLocale == {value} ? 'vis-blue' : 'white'}"> <!-- here -->
            @languages/{value}
        </label>
    </table>
</:each>

Instead I receive:

Exception in thread "LWJGL Application" com.github.czyzby.lml.util.LmlParsingException: Error occurred during parsing near line 24 of the original file: "locale-selector.lml" during parsing template part: "'each' macro result" on line: 9 of its content. Template part is most likely an evaluated macro or argument result, extracted from the original template.
REASON: Unable to obtain color with name: 'vis
	Due implementation of the parser, the real problematic line might SLIGHTLY vary from the given line number(s), but exception message should be clear enough to find the actual error.
	Currently parsed template part:
6  |VALID|            row="true">
7  |VALID|         <label align="left"
8  |VALID|                growx="true"
9  |ERROR|                color="{? 'en' == 'en' ? 'vis-blue' : 'white'}">
10 |     |             @languages/en
11 |     |         </label>
12 |     |     </table>

	This template part was most likely evaluated during parsing this original template part (if a macro or an argument ends on this line, its content most likely causes the error): 
21 |VALID| </:each>
22 |VALID|         </table>
23 |VALID|     </dialog>
24 |ERROR| </:noop>
25 |     | 

@edit
Even simple condition returns "vis

<label>
    {? 4 > 1 ? "vis-blue"}
</label>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions