as7: accept (decimal) digits in octal constants, like as.s does!

This commit is contained in:
phil
2020-10-05 19:19:06 -04:00
parent 6e0f90c5a9
commit a08d97c8d8
+5 -1
View File
@@ -514,7 +514,11 @@ sub parse_expression {
my $value = $1; my $value = $1;
printf "\tfound constant: $value\n" if ($debug); printf "\tfound constant: $value\n" if ($debug);
if ( $value =~ m{^0} ) { if ( $value =~ m{^0} ) {
$syllable = oct($value); # PLB 2020-10-05: behave like as.s
$syllable = 0;
for my $digit (split(//, $value)) {
$syllable = $syllable * 010 + ord($digit) - ord('0');
}
} }
else { else {
$syllable = $value + 0; $syllable = $value + 0;