Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should probably allow comma at end? #64

Open
NoSloppy opened this issue Mar 26, 2023 · 4 comments
Open

Should probably allow comma at end? #64

NoSloppy opened this issue Mar 26, 2023 · 4 comments

Comments

@NoSloppy
Copy link
Contributor

I think a majority of copy/paste from config files will include a trailing comma like >(),

This currently is allowed to be submitted and works, but throws an error "Expected identifier or number"
It goes away of course once clicking the right side structured view and the StylePtr<>() gets stripped.

@NoSloppy
Copy link
Contributor Author

hmm. not doing it now.

@NoSloppy
Copy link
Contributor Author

Wait...yes it is.

@NoSloppy NoSloppy reopened this Mar 27, 2023
@NoSloppy
Copy link
Contributor Author

NoSloppy commented Apr 2, 2023

This change seems to work, not sure it doesn't break something else though?

identifier() {
    var ret = "";
    while (true) {
      var c = this.peek();
      if ((c >= 'a' && c <= 'z') ||
    (c >= 'A' && c <= 'Z') ||
    (c >= '0' && c <= '9') || c == '_' || c == ':' ||
    /* allow StylePtr<.....>(), ending that has a trailing comma */
    (c == ")" && this.peek2() == ",")) {
  ret += c;
  this.pos++;
      } else {
  return ret;
      }
    }
  }

@NoSloppy
Copy link
Contributor Author

NoSloppy commented Apr 2, 2023

I can't make heads or tails of this. Sometimes it seems to work, sometimes not.
Adding the line in the comment above seems to just produce the same "sometimes" results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant