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

Expand last example in the grammars tutorial to allow comments and blank lines #1759

Closed
tbrowder opened this issue Feb 7, 2018 · 6 comments
Assignees
Labels
docs Documentation issue (primary issue type) update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.

Comments

@tbrowder
Copy link
Member

tbrowder commented Feb 7, 2018

For example, fix grammar and actions to handle this input format (key/value input with comments and blank lines allowed):

my $s = q:to/EOI/;
# data for one baseball player
    name = Ray Henderson # nickname and last name
    hits = 42
    homers=62
    strike-outs =    # may e empty
 
 # another player
    name = Bat Masterson
    hits = 24

EOI
@coke
Copy link
Collaborator

coke commented Feb 9, 2018

What document URL/file is this referring to?

@JJ
Copy link
Contributor

JJ commented Feb 10, 2018

I want to say the Grammars tutorial, but I'm not sure either...

@tbrowder
Copy link
Member Author

Sorry, not too clear. Actually, both grammar files could use it, but I was originally referring to the last example in 'doc/doc/language/grammars.pod6'.

@JJ JJ added the docs Documentation issue (primary issue type) label Feb 10, 2018
@JJ JJ added the update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. label May 20, 2018
@tbrowder tbrowder self-assigned this Oct 25, 2018
@JJ JJ changed the title expand last example to allow comments and blank lines Expand last example in the grammars tutorial to allow comments and blank lines Oct 5, 2019
@JJ JJ self-assigned this Oct 5, 2019
@JJ
Copy link
Contributor

JJ commented Oct 5, 2019

Would the white space separate two players? In that case, we need a higher-level grammar to take care of that. It would certainly increase the value of the tutorial, but I think it might be better to include another example rather than expand the current one.

JJ added a commit that referenced this issue Oct 5, 2019
@JJ
Copy link
Contributor

JJ commented Oct 6, 2019

There's an additional problem here, it's that it does not work if we use the default ws token. It fails in the action, with:

No such method 'key' for invocant of type 'Any'. Did you mean 'keys'?
  in block <unit> at key-value-pairs.p6 line 18

JJ added a commit to JJ/my-raku-examples that referenced this issue Oct 6, 2019
@JJ
Copy link
Contributor

JJ commented Oct 6, 2019

There's an additional problem with that example, and it's that it's redefining whitespace arbitrarily just because it's using a rule instead of a token. I think I'm going ot change that, for starters, and to reduce confusion.

JJ added a commit that referenced this issue Oct 6, 2019
So that it can be expanded to fulfill #1759
JJ added a commit to JJ/my-raku-examples that referenced this issue Oct 8, 2019
@JJ JJ closed this as completed in d1c5b4c Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
Projects
None yet
Development

No branches or pull requests

3 participants