3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

compiler_vm: fix interwined comments losing first ; after // (#60)

This commit is contained in:
0xACE 2021-09-16 04:31:11 +00:00 committed by GitHub
parent 76479ed8cf
commit e00ba2e62f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,7 +352,7 @@ sub preprocess_code {
$self->{code} =~ s/\s+$//;
$self->{code} =~ s/;\s*;\n/;\n/gs;
$self->{code} =~ s/;(\s*\/\*.*?\*\/\s*);\n/;$1/gs;
$self->{code} =~ s/;(\s*\/\/.*?\s*);\n/;$1/gs;
$self->{code} =~ s/;(\s*\/\/.*?\s*);\n/;$1;/gs;
$self->{code} =~ s/(\{|})\n\s*;\n/$1\n/gs;
$self->{code} =~ s/(?:\n\n)+/\n\n/g;