mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 07:24:09 +01:00
compiler_vm: fix leading whitespace in $func_regex (#61)
Fixes the issue where a function has a trailing whitespace before a line break. example: ``` void foo(){} int main(){return 0;} ```
This commit is contained in:
parent
347e4ac69f
commit
7692b57f58
@ -237,7 +237,7 @@ sub preprocess_code {
|
||||
|
||||
print "looking for functions, has main: $has_main\n" if $self->{debug} >= 2;
|
||||
|
||||
my $func_regex = qr/^([ *\w]+)\s+([ ()*\w:\\]+)\s*\(([^;{]*)\s*\)\s*(\{.*|<%.*|\?\?<.*)/ims;
|
||||
my $func_regex = qr/^\s*([ *\w]+)\s+([ ()*\w:\\]+)\s*\(([^;{]*)\s*\)\s*(\{.*|<%.*|\?\?<.*)/ims;
|
||||
|
||||
# look for potential functions to extract
|
||||
while($preprecode =~ /$func_regex/ms) {
|
||||
|
Loading…
Reference in New Issue
Block a user