mirror of
https://codeberg.org/scip/rpnc.git
synced 2025-12-17 04:21:01 +01:00
added check if custom func already exists
This commit is contained in:
17
rpnc
17
rpnc
@@ -556,14 +556,17 @@ sub defun {
|
||||
return;
|
||||
}
|
||||
|
||||
if (grep {$name eq $_} keys %commands) {
|
||||
print "reserved function name (command)!\n";
|
||||
return;
|
||||
}
|
||||
if (! exists $custom{$name}) {
|
||||
# no need to check twice and overwriting of custom function must be legal
|
||||
if (grep {$name eq $_} keys %commands) {
|
||||
print "reserved function name (command)!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (grep {$name eq $_} keys %func) {
|
||||
print "reserved function name (function)!\n";
|
||||
return;
|
||||
if (grep {$name eq $_} keys %func) {
|
||||
print "reserved function name (function)!\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$custom{$name} = "@tokens";
|
||||
|
||||
Reference in New Issue
Block a user