File tree 4 files changed +11
-5
lines changed
4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ Revision history for Perl extension PPI
2
2
3
3
{{$NEXT}}
4
4
- Allow zero byte documents to have a location
5
+ - Allow variable names to have whitespace after the sigil (GH#158)
5
6
6
7
1.281 2024-12-27 14:44:47Z
7
8
Summary:
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ sub __TOKENIZER__on_char {
162
162
163
163
# Suck in till the end of the symbol
164
164
pos $t -> {line } = $t -> {line_cursor };
165
- if ( $t -> {line } =~ m /\G ([\w :\' ]+)/ gc ) {
165
+ if ( $t -> {line } =~ m /\G (\s * [\w :\' ]+)/ gc ) {
166
166
$t -> {token }-> {content } .= $1 ;
167
167
$t -> {line_cursor } += length $1 ;
168
168
}
@@ -201,6 +201,7 @@ sub __TOKENIZER__on_char {
201
201
my $pattern = qr /
202
202
^(
203
203
[\$ @%&*]
204
+ \s *
204
205
(?:
205
206
: (?! : ) # allow single-colon non-magic variables
206
207
|
Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ sub __TOKENIZER__on_char {
115
115
return 1;
116
116
}
117
117
118
+ if ( $char eq ' ' ) {
119
+ pos $t -> {line } = $t -> {line_cursor } + 1;
120
+ if ( $t -> {line } =~ m /\G\s *[a-z_] / gci ) {
121
+ $t -> {class } = $t -> {token }-> set_class(' Symbol' );
122
+ return 1;
123
+ }
124
+ }
125
+
118
126
# Is it a nameless arg in a signature?
119
127
if ( $char eq ' )' or $char eq ' =' or $char eq ' ,' ) {
120
128
my ($has_sig ) = $t -> _current_token_has_signatures_active;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ use PPI::Dumper;
13
13
sub test_document ;
14
14
15
15
BASE_SPACE_SYMBOL: {
16
- local $TODO = " crashes" ;
17
16
test_document #
18
17
' $ s' , #
19
18
[
@@ -24,7 +23,6 @@ BASE_SPACE_SYMBOL: {
24
23
}
25
24
26
25
FOR_LOOP: {
27
- local $TODO = " crashes" ;
28
26
test_document
29
27
' for my $ s ( qw( a b ) ) { say $s }' ,
30
28
[
@@ -48,7 +46,6 @@ FOR_LOOP: {
48
46
}
49
47
50
48
SIGIL_WITH_TRASH: {
51
- local $TODO = " crashes" ;
52
49
test_document
53
50
' $ \"8;b' ,
54
51
[
@@ -61,7 +58,6 @@ SIGIL_WITH_TRASH: {
61
58
}
62
59
63
60
SIGIL_WITH_TABS_AND_TRAIL: {
64
- local $TODO = " crashes" ;
65
61
test_document #
66
62
' $ b ' , #
67
63
[ #
You can’t perform that action at this time.
0 commit comments