Unary minus operator is now sticked to its argument when put between parentheses or brackets.

[GB.EVAL]
* NEW: Unary minus operator is now sticked to its argument when put between parentheses or brackets.
This commit is contained in:
gambas 2019-03-14 01:52:37 +01:00
parent d26bb8594d
commit a8bcabb741

View file

@ -516,7 +516,20 @@ static void analyze(EVAL_ANALYZE *result)
//space_before = FALSE;
space_after = FALSE;
}
else if (PATTERN_is(*pattern, RS_NOT) || *symbol == '-')
else if (*symbol == '-')
{
if (old_type == RT_OPERATOR && (PATTERN_is(pattern[-1], RS_LBRA) || PATTERN_is(pattern[-1],RS_LSQR)))
{
space_before = FALSE;
space_after = FALSE;
}
else
{
space_before = TRUE;
space_after = TRUE;
}
}
else if (PATTERN_is(*pattern, RS_NOT))
{
if (old_type == RT_OPERATOR && (PATTERN_is(pattern[-1], RS_LBRA) || PATTERN_is(pattern[-1],RS_LSQR)))
space_before = FALSE;