mirror of
https://github.com/softwarejanitor/as65.git
synced 2024-11-28 02:49:25 +00:00
Fixed parsing errors
This commit is contained in:
parent
67840c5ad6
commit
1ad93515af
18
as65.pl
18
as65.pl
@ -1913,7 +1913,7 @@ sub parse_line {
|
|||||||
my ($line, $lineno) = @_;
|
my ($line, $lineno) = @_;
|
||||||
|
|
||||||
my ($label, $mnemonic, $operand, $comment) = ('', '', '', '');
|
my ($label, $mnemonic, $operand, $comment) = ('', '', '', '');
|
||||||
if ($line =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(;.+)$/) {
|
if ($line =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(;.*)$/) {
|
||||||
$label = $1;
|
$label = $1;
|
||||||
$mnemonic = $2;
|
$mnemonic = $2;
|
||||||
$operand = $3;
|
$operand = $3;
|
||||||
@ -1923,7 +1923,7 @@ sub parse_line {
|
|||||||
$mnemonic = $2;
|
$mnemonic = $2;
|
||||||
$operand = $3;
|
$operand = $3;
|
||||||
$comment = '';
|
$comment = '';
|
||||||
} elsif ($line =~ /^\s+(\S+)\s+(\S+)\s+(;.+)$/) {
|
} elsif ($line =~ /^\s+(\S+)\s+(\S+)\s+(;.*)$/) {
|
||||||
$label = '';
|
$label = '';
|
||||||
$mnemonic = $1;
|
$mnemonic = $1;
|
||||||
$operand = $2;
|
$operand = $2;
|
||||||
@ -1933,7 +1933,7 @@ sub parse_line {
|
|||||||
$mnemonic = $1;
|
$mnemonic = $1;
|
||||||
$operand = $2;
|
$operand = $2;
|
||||||
$comment = '';
|
$comment = '';
|
||||||
} elsif ($line =~ /^\s+(\S+)\s+;\s*$/) {
|
} elsif ($line =~ /^\s+(\S+)\s+(;.*)$/) {
|
||||||
$label = '';
|
$label = '';
|
||||||
$mnemonic = $1;
|
$mnemonic = $1;
|
||||||
$operand = '';
|
$operand = '';
|
||||||
@ -1953,22 +1953,22 @@ sub parse_line {
|
|||||||
$mnemonic = $2;
|
$mnemonic = $2;
|
||||||
$operand = '';
|
$operand = '';
|
||||||
$comment = '';
|
$comment = '';
|
||||||
} elsif ($line =~ /^\s+(\S+)\s+(;.+)$/) {
|
} elsif ($line =~ /^\s+(\S+)\s+(;.*)$/) {
|
||||||
$label = '';
|
$label = '';
|
||||||
$mnemonic = $1;
|
$mnemonic = $1;
|
||||||
$operand = '';
|
$operand = '';
|
||||||
$comment = $2;
|
$comment = $2;
|
||||||
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(;.+)$/) {
|
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(;.*)$/) {
|
||||||
$label = $1;
|
$label = $1;
|
||||||
$mnemonic = $2;
|
$mnemonic = $2;
|
||||||
$operand = '';
|
$operand = '';
|
||||||
$comment = $4;
|
$comment = $3;
|
||||||
} elsif ($line =~ /^(\S+)\s+([Aa][Ss][Cc])\s+(".+")\s+(;.+)$/) {
|
} elsif ($line =~ /^(\S+)\s+([Aa][Ss][Cc])\s+(".+")\s+(;.*)$/) {
|
||||||
$label = $1;
|
$label = $1;
|
||||||
$mnemonic = $2;
|
$mnemonic = $2;
|
||||||
$operand = $3;
|
$operand = $3;
|
||||||
$comment = $4;
|
$comment = $4;
|
||||||
} elsif ($line =~ /^\s+([Aa][Ss][Cc])\s+(".+")\s+(;.+)$/) {
|
} elsif ($line =~ /^\s+([Aa][Ss][Cc])\s+(".+")\s+(;.*)$/) {
|
||||||
$label = '';
|
$label = '';
|
||||||
$mnemonic = $1;
|
$mnemonic = $1;
|
||||||
$operand = $2;
|
$operand = $2;
|
||||||
@ -2021,7 +2021,7 @@ if (open($ifh, "<$input_file")) {
|
|||||||
|
|
||||||
# Skip comment lines.
|
# Skip comment lines.
|
||||||
next if $line =~ /^\s*;/;
|
next if $line =~ /^\s*;/;
|
||||||
next if $line =~ /\*/;
|
next if $line =~ /^\s*\*/;
|
||||||
|
|
||||||
# Process .org lines.
|
# Process .org lines.
|
||||||
if ($line =~ /^\.org\s+(.+)/) {
|
if ($line =~ /^\.org\s+(.+)/) {
|
||||||
|
Loading…
Reference in New Issue
Block a user