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

Special rule for tokens to handle spacing #28

Closed
ptal opened this issue Jul 17, 2014 · 1 comment
Closed

Special rule for tokens to handle spacing #28

ptal opened this issue Jul 17, 2014 · 1 comment
Labels

Comments

@ptal
Copy link
Owner

ptal commented Jul 17, 2014

It's cumbersome to treat the spacing inside the grammar.

peg!(
  grammar ntcc;

  comparison = le / neq / lt / ge / gt / eq
  spacing = [" \n\t"]*

  tokens(spacing) {
     lt = "<"
     le = "<="
     gt = ">"
     ge = ">="
     eq = "=="
     neq = "<>"
  }
)

"tokens" is a special keyword parametrized by a separator applied before and after each tokens.

@ptal ptal added the grammar label Jul 20, 2014
@ptal
Copy link
Owner Author

ptal commented Jul 28, 2016

This will be handle in a different way. Due to #80 we will be able to directly match on a token stream. For now, we close this because it does not seem the "right" way anymore.

@ptal ptal closed this as completed Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant