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

Comments

Projects
None yet
1 participant
@ptal
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

This comment has been minimized.

Show comment
Hide comment
@ptal

ptal Jul 28, 2016

Owner

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.

Owner

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 Jul 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment