Skip to content

Negative @position coordinates are parsed as zero #493

@hjotha

Description

@hjotha

Problem

@position accepts integer coordinates, including negative canvas coordinates emitted by describe for existing microflows. The parser accepts a leading minus syntactically, but the visitor currently reads only direct NUMBER_LITERAL nodes when converting annotation parameters to integers.

Because -150 is parsed as a unary expression, the coordinate silently falls back to 0. A describe/exec/describe cycle can therefore move activities from negative canvas positions to zero.

Expected behavior

Negative integer annotation coordinates should round-trip as authored:

@position(-150, -210)
log info node 'SyntheticLog' 'message';

should keep X = -150 and Y = -210 in the AST and generated microflow object.

Proposed fix

Parse the raw annotation parameter text as an integer before falling back to the existing literal-only path. This preserves signed integer coordinates without evaluating arbitrary annotation expressions.

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