Skip to content

Commit 570ae4f

Browse files
committed
fixes microsoft#6591: [perl] wrong coloring when space after regexp
1 parent 7d0f18a commit 570ae4f

3 files changed

Lines changed: 3348 additions & 4 deletions

File tree

extensions/perl/syntaxes/Perl.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<key>comment</key>
5757
<string>string.regexp.compile.perl</string>
5858
<key>end</key>
59-
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|$))</string>
59+
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|\s*$))</string>
6060
<key>endCaptures</key>
6161
<dict>
6262
<key>1</key>
@@ -309,7 +309,7 @@
309309
<key>comment</key>
310310
<string>string.regexp.find-m.perl</string>
311311
<key>end</key>
312-
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|$))</string>
312+
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|\s*$))</string>
313313
<key>endCaptures</key>
314314
<dict>
315315
<key>1</key>
@@ -595,7 +595,7 @@
595595
<key>comment</key>
596596
<string>string.regexp.replace.perl</string>
597597
<key>end</key>
598-
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)\]&gt;]|$))</string>
598+
<string>((([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)\]&gt;]|\s*$))</string>
599599
<key>endCaptures</key>
600600
<dict>
601601
<key>1</key>
@@ -1161,7 +1161,7 @@
11611161
<key>contentName</key>
11621162
<string>string.regexp.find.perl</string>
11631163
<key>end</key>
1164-
<string>((\1([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|$))</string>
1164+
<string>((\1([egimosxradlupc]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|\s*$))</string>
11651165
<key>endCaptures</key>
11661166
<dict>
11671167
<key>1</key>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
die("[$sheet->{label}] Unexpected sheet format.") unless (
2+
$sheet->{"$date_col$row"} =~ /CALL_DATE/i &&
3+
$sheet->{"$pixel_cols[4]$row"} =~ /Home_Bind_Count/i
4+
);
5+
6+
$row++;
7+
while ($row < $sheet->{maxrow}) {
8+
$row++;
9+
$total_lines++;
10+
11+
my $date = $sheet->{"$date_col$row"};
12+
next unless $date;
13+
(warning "Unexpected date format: '$date'"), next unless ($date =~ /^2\d\d\d-\d\d-\d\d$/);
14+
15+
my $phone = trim($sheet->{"$phone_col$row"});
16+
(warning "Unexpected phone format: '$phone'."), next unless ($phone =~ /^\d{10}$/);
17+
18+
info $phone;
19+
next if ($date gt $date_to || $date lt $date_from);
20+
21+
my @pixels = (0) x 5;
22+
for (1..4) {
23+
$pixels[$_] = trim($sheet->{"$pixel_cols[4]$row"});
24+
(warning "Pixel $_ is not a number in the row # $row."), next unless looks_like_number($pixels[$_]);
25+
};
26+
27+
for (1..4) {
28+
add_phone_activity($date, $phone, "pixel-$_", $pixels[$_]) if $pixels[$_];
29+
};
30+
$parsed_lines++;
31+
};

0 commit comments

Comments
 (0)