Skip to content

Parser should point to the name of non-existent functions rather than the end of the line #2637

Closed
@bgoodri

Description

@bgoodri

Summary:

If a user tries to use a function that does not exist or otherwise specifies it wrong, the parser says something like error in ... at line X, column Y where Y is the end of the line. This confuses RStudio's error flagging (which goes off Y) and makes it look like the problem is with whatever is the last argument to the function, rather than the function itself.

Description:

See rstudio/rstudio#3474

Reproducible Steps:

Parse this

data {
  real mu;
  real<lower=0> sigma;
}
transformed data {
  real z = foo(mu, sigma);
}

Current Output:

SYNTAX ERROR, MESSAGE(S) FROM PARSER:

No matches for: 

  foo(real, real)

Function foo not found.
  error in 'model573502d9042_foo' at line 6, column 26
  -------------------------------------------------
     4: }
     5: transformed data {
     6:   real z = foo(mu, sigma);
                                 ^
     7: }
  -------------------------------------------------

Expected Output:

error in 'model573502d9042_foo' at line 6, column 14 (or maybe 12, something pointing to foo instead of the semicolon)

Additional Information:

Not a huge priority

Current Version:

v2.18.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions