Skip to content

Commit

Permalink
Fix for #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Aug 4, 2014
1 parent 2e70d60 commit 6fa59bb
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/TestML/Compiler/Pegex/Grammar.pm
Expand Up @@ -5,7 +5,7 @@ extends 'Pegex::Grammar';

use constant file => '../testml-pgx/testml.pgx';

sub make_tree {
sub make_tree { # Generated/Inlined by Pegex::Grammar (0.43)
{
'+grammar' => 'testml',
'+include' => 'atom',
Expand Down Expand Up @@ -465,7 +465,7 @@ sub make_tree {
]
},
'point_lines' => {
'.rgx' => qr/\G((?:(?!===|\-\-\-).*\r?\n)*)/
'.rgx' => qr/\G((?:(?!(?:===|\-\-\-)\ \w).*\r?\n)*)/
},
'point_marker' => {
'.rgx' => qr/\G\-\-\-/
Expand Down
7 changes: 7 additions & 0 deletions test/TestMLBridge.pm
Expand Up @@ -30,4 +30,11 @@ sub f2 {
return num $num * $num + $num;
}

sub replace_with_dots {
my ($self, $text) = @_;
$text = $text->value;
$text =~ s/\S/./g;
return str $text;
}

1;
10 changes: 10 additions & 0 deletions test/testml-edge-cases.t
@@ -0,0 +1,10 @@
use strict;
use File::Basename;
use lib dirname(__FILE__);
use TestML;
use TestMLBridge;

TestML->new(
testml => 'testml/edge-cases.tml',
bridge => 'TestMLBridge',
)->run;
23 changes: 23 additions & 0 deletions test/testml/edge-cases.tml
@@ -0,0 +1,23 @@
%TestML 0.1.0

Plan = 1

*input.replace_with_dots == *output

=== Allow text looking like --- or === markers
--- input
---
--- &foo
==
====
===foo bar
\--- foo
\=== bar
--- output
...
... ....
..
....
...... ...
... ...
... ...

0 comments on commit 6fa59bb

Please sign in to comment.