tweaks to formatting and optimize map definitions

This commit is contained in:
gnembon committed 2025-02-20 09:22:13 +01:00
1 parent 947e13835e
commit 7087fa8510
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -1727,7 +1727,7 @@ public class Expression
// a few exceptions which we don't implement in the framework for simplicity for now
if (!operation.pure())
{
if (!symbol.equals("->") || expectedType != Context.Type.MAPDEF)
if (!(symbol.equals("->") || symbol.equals("define")) || expectedType != Context.Type.MAPDEF)
{
return optimized;
}
@@ -1772,7 +1772,7 @@ public class Expression
{
result = ((ILazyOperator) operation).lazyEval(ctx, expectedType, this, node.token, args.get(0), args.get(1)).evalValue(null, expectedType);
}
node.token.disguiseAs(null, "=>"+result.getString());
node.token.disguiseAs(null, "=> "+result.getString());
node.op = LazyValue.ofConstant(result);
if (logger != null)
{
@@ -615,7 +615,7 @@ public class ScriptCommand
{
return Carpet.Messenger_compose(styleForToken(token) + " " + surface);
}
return Carpet.Messenger_compose(styleForToken(token)+"br " + surface, "^gi " + token.comment);
return Carpet.Messenger_compose(styleForToken(token)+"u " + surface, "^gi " + token.comment);
}
private static String styleForToken(Token token)