@@ -15,40 +15,51 @@ token the_object {
15
15
[
16
16
<before ' $' > <Perlito5::Grammar::Sigil.term_sigil>
17
17
<!before ' +' >
18
- <.Perlito5::Grammar::Space.opt_ws>
19
18
{
20
19
$MATCH -> {capture } = Perlito5::Match::flat($MATCH -> {' Perlito5::Grammar::Sigil.term_sigil' })-> [1];
21
20
}
22
21
|
23
22
' {' <Perlito5::Expression.curly_parse> ' }'
24
- <.Perlito5::Grammar::Space.opt_ws>
25
- <!before ' ,' >
26
23
{
27
24
$MATCH -> {capture } = Perlito5::Match::flat($MATCH -> {' Perlito5::Expression.curly_parse' });
28
25
}
29
26
|
30
27
<typeglob>
31
- <.Perlito5::Grammar::Space.opt_ws>
32
- <!before ' ,' >
33
28
{
34
29
$MATCH -> {capture } = Perlito5::Match::flat($MATCH -> {' typeglob' });
35
30
}
36
31
]
37
32
38
33
{
39
- my $s = substr ($MATCH -> {str }, $MATCH -> {to }, 1);
40
- if ( $s eq ' ,' ) {
34
+ my $pos = $MATCH -> {to };
35
+ my $m = Perlito5::Grammar::Space-> ws($MATCH -> {str }, $pos );
36
+ $pos = $m -> {to } if $m ;
37
+
38
+ my $s = substr ($MATCH -> {str }, $pos , 1);
39
+ my $s2 = substr ($MATCH -> {str }, $pos , 2);
40
+
41
+ # print Perlito5::Dumper::Dumper $MATCH;
42
+ # print "after: $MATCH->{capture} $pos '$MATCH->{str}' '$s' '$s2'\n";
43
+
44
+ if ( $s eq ' ,'
45
+ || $s eq ' ?'
46
+ || $s2 eq ' ->'
47
+ || $s eq ' ['
48
+ || $s eq ' {'
49
+ || $s eq ' ('
50
+ )
51
+ {
41
52
return
42
53
}
43
54
if ( $s eq ' +' ) {
44
- my $m = Perlito5::Grammar::Space-> ws($MATCH -> {str }, $MATCH -> { to } + 1);
55
+ my $m = Perlito5::Grammar::Space-> ws($MATCH -> {str }, $pos + 1);
45
56
if ($m ) {
46
57
return
47
58
}
48
59
# print "space + non-space\n";
49
60
}
50
61
else {
51
- my $m = Perlito5::Precedence-> op_parse($MATCH -> {str }, $MATCH -> { to } , 1);
62
+ my $m = Perlito5::Precedence-> op_parse($MATCH -> {str }, $pos , 1);
52
63
my $next_op = $m ? Perlito5::Match::flat($m )-> [1] : ' ' ;
53
64
my $is_infix = Perlito5::Precedence::is_fixity_type(' infix' , $next_op );
54
65
# print "is_infix $is_infix '$next_op'\n";
0 commit comments