Skip to content

Commit

Permalink
new pegex changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Mar 30, 2014
1 parent 8df76b0 commit 4b462fe
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions lib/TestML/Compiler/Pegex/Grammar.pm
Expand Up @@ -6,7 +6,13 @@ use constant file => '../testml-pgx/testml.pgx';

sub make_tree {
{
'+grammar' => 'testml',
'+include' => 'atom',
'+toprule' => 'testml_document',
'+version' => '0.0.1',
'__' => {
'.rgx' => qr/\G(?:[\ \t]|\r?\n|\#.*\r?\n)+/
},
'assertion_call' => {
'.any' => [
{
Expand Down Expand Up @@ -121,6 +127,9 @@ sub make_tree {
'blank_line' => {
'.rgx' => qr/\G[\ \t]*\r?\n/
},
'blanks' => {
'.rgx' => qr/\G[\ \t]+/
},
'block_header' => {
'.all' => [
{
Expand All @@ -130,15 +139,15 @@ sub make_tree {
'+max' => 1,
'.all' => [
{
'.rgx' => qr/\G[\ \t]+/
'.ref' => 'blanks'
},
{
'.ref' => 'block_label'
}
]
},
{
'.rgx' => qr/\G[\ \t]*\r?\n/
'.ref' => 'blank_line'
}
]
},
Expand Down Expand Up @@ -250,7 +259,7 @@ sub make_tree {
'+min' => 0,
'.any' => [
{
'.rgx' => qr/\G(?:[\ \t]|\r?\n|\#.*\r?\n)+/
'.ref' => '__'
},
{
'.ref' => 'assignment_statement'
Expand Down Expand Up @@ -337,7 +346,7 @@ sub make_tree {
'+min' => 0,
'.any' => [
{
'.rgx' => qr/\G(?:[\ \t]|\r?\n|\#.*\r?\n)+/
'.ref' => '__'
},
{
'.ref' => 'assignment_statement'
Expand Down Expand Up @@ -385,13 +394,13 @@ sub make_tree {
'.ref' => 'point_marker'
},
{
'.rgx' => qr/\G[\ \t]+/
'.ref' => 'blanks'
},
{
'.ref' => 'point_name'
},
{
'.rgx' => qr/\G[\ \t]*\r?\n/
'.ref' => 'blank_line'
},
{
'.ref' => 'point_lines'
Expand All @@ -410,7 +419,7 @@ sub make_tree {
'.ref' => 'point_marker'
},
{
'.rgx' => qr/\G[\ \t]+/
'.ref' => 'blanks'
},
{
'.ref' => 'point_name'
Expand Down

0 comments on commit 4b462fe

Please sign in to comment.