stan-dev / stan-dev/rstan

syntax checking, "warning: missing terminating ' character"

Open
#793 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Checking a Stan file, either from RStudio or the console, e.g.,

> rstan:::rstudio_stanc("test.stan")

or

rstan:::stanc("test.stan")

that uses the transpose operator, e.g.,

transformed data {
  vector[2] a = [1,1]';
}

throws a warning:

/var/folders/pg/qc4jx60s2ys3smt604547ckw0000gn/T//RtmpJ1AeUQ/file7cf7321b3a6a.stan:2:22: warning: missing terminating ' character [-Winvalid-pp-token]
  vector[2] a = [1,1]';
                     ^
1 warning generated.

I suspect it's flagging the transpose as a string or something.

Rstan: 2.21.2
StanHeaders: 2.21.0-5
RStudio: 1.3.1056
R: 4.02

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning with rstan:::rstudio_stanc("test.stan") or rstan:::stanc("test.stan") using the transpose expression shown in the issue. Trace the syntax-checking entry point and determine where the diagnostic is produced; done means the Stan file checks successfully without the spurious missing-terminating-character warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.