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

most pre-defined tokens (i.e. Grammar methods) aren't documented #864

Closed
smls opened this issue Aug 26, 2016 · 1 comment
Closed

most pre-defined tokens (i.e. Grammar methods) aren't documented #864

smls opened this issue Aug 26, 2016 · 1 comment
Labels
docs Documentation issue (primary issue type)

Comments

@smls
Copy link
Contributor

smls commented Aug 26, 2016

/language/grammars#Special_Tokens documents only two pre-defined tokens: <ws> and <!>

But there are actually quite a few more.

S05#Predefined_Subrules lists these:

<!> <?> alnum alpha blank cntrl digit graph ident lower print punct space upper wb ws ww xdigit

And Rakudo introspection reveals:

➜  say Grammar.^methods».name.sort;
(!APPEND_TO_ORIG !BACKREF !BACKREF-LATEST-CAPTURE !DELEGATE_ACCEPTS !DYNQUANT_LIMITS !LITERAL !alt !alt_nfa !clear_highwater !cursor_capture !cursor_fail !cursor_init !cursor_more !cursor_next !cursor_pass !cursor_pos !cursor_push_cstack !cursor_start !cursor_start_all !cursor_start_cur !cursor_start_fail !cursor_start_subcapture !dba !fresh_highexpect !highexpect !highwater !precompute_nfas !protoregex !protoregex_nfa !protoregex_table !reduce !reduce_with_match !set_highexpect !shared Bool CALL_SUBRULE CAPHASH DYNQUANT_LIMITS FAILGOAL INDMETHOD INDRULE INTERPOLATE MATCH MATCH_SAVE OTHERGRAMMAR RECURSE after alnum alpha at before blank cntrl digit from graph ident lower orig parse parsefile pos print prune punct same space subparse target upper wb ws ww xdigit)

A bunch of those are Rakudo internals, but the intersection of that list with the S05 list, are the ones that should probably be officially documented... :p

Since they're technically methods of class Grammar, I think they should be listed as routines (with keyword token instead of method) on /type/Grammar, but it probably wouldn't hurt mentioning them on /language/grammars as well.


¹ TOP is special, since it isn't a pre-defined token, but rather one that user code is expected to define.

@smls smls added the docs Documentation issue (primary issue type) label Aug 26, 2016
@moritz
Copy link
Collaborator

moritz commented Sep 1, 2017

They are now mentioned in doc/Language/regexes.pod6.

@moritz moritz closed this as completed Sep 1, 2017
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)
Projects
None yet
Development

No branches or pull requests

2 participants