Skip to content

Commit

Permalink
[grammars] explain <foo> calling syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 23, 2010
1 parent d9997e5 commit 54850cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/grammars.pod
Expand Up @@ -71,6 +71,11 @@ reference).
A grammar contains various named regexes, one of which is
called C<TOP>, and is called by C<JSON::Tiny.parse($string)>.

Regexes inside a grammar do not need a scope declarator, the default to the
same lookup semantics as methods in classes. The call to another regex
simplifies to C<< <regex_name> >>, which also creates a capture of the same
name.

Rule C<TOP> anchors the match to the start and end of the string, so that the
whole string has to be in valid JSON format for the match to succeed. It then
either matches an C<< <array> >> or an C<< <object> >>, both of which are
Expand Down

0 comments on commit 54850cf

Please sign in to comment.