1
0
mirror of https://github.com/DoctorWkt/pdp7-unix.git synced 2026-01-11 23:53:23 +00:00

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

View File

@ -514,7 +514,11 @@ sub parse_expression {
my $value = $1;
printf "\tfound constant: $value\n" if ($debug);
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 {
$syllable = $value + 0;