From a08d97c8d8da36630566dcd73585eb444667a0e7 Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 5 Oct 2020 19:19:06 -0400 Subject: [PATCH] as7: accept (decimal) digits in octal constants, like as.s does! --- tools/as7 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/as7 b/tools/as7 index 221e503..571ef47 100755 --- a/tools/as7 +++ b/tools/as7 @@ -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;