Skip to content

Document the parsing rules for arithmetic expressions #314

@petdance

Description

@petdance

It seems that TT requires spaces around math operators sometimes. For example this runs just fine:

x = 5;

y = x + 2; ' y='; y;
y = x - 2; ' y='; y;
y = x * 2; ' y='; y;
y = x / 2; ' y='; y;

and gives

 y=7 y=3 y=10 y=2.5

However, this fails parsing:

x = 5;
y = x+2; ' y='; y;
y = x-2; ' y='; y;
y = x*2; ' y='; y;
y = x/2; ' y='; y;

on the x-2. Comment that line out, and it also fails on the x/2.

If it's documented somewhere that x-2 is not valid but x - 2 is, I can't find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions