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