mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-02-25 00:27:43 +00:00
as: parse: stmt_after_uinteger/3: move out of insn parsing block, correct diagnostic
This commit is contained in:
@@ -105,6 +105,13 @@ stmt(ScanState) ->
|
||||
%% This means that "opcode (...)" is interpreted as having a displacement but no
|
||||
%% index. Use "opcode 0(index)" if an index with zero displacement is needed.
|
||||
|
||||
%% <stmt> ::= <uinteger> . ":"
|
||||
stmt_after_uinteger(ScanState, Location, UInt) ->
|
||||
case scan:token(ScanState) of
|
||||
{ok, {_Location, ?T_COLON}} -> {ok, {Location, #s_local_label{number = UInt}}};
|
||||
ScanRes -> badtok("junk after local label", ScanRes)
|
||||
end.
|
||||
|
||||
stmt_after_symbol(ScanState, Location, Name) ->
|
||||
case scan:token(ScanState) of
|
||||
{ok, {_Location, ?T_COLON}} -> {ok, {Location, #s_label{name = Name}}};
|
||||
@@ -116,13 +123,6 @@ stmt_after_symbol(ScanState, Location, Name) ->
|
||||
ScanRes -> badtok("junk after symbol", ScanRes)
|
||||
end.
|
||||
|
||||
%% <stmt> ::= <uinteger> . ":"
|
||||
stmt_after_uinteger(ScanState, Location, UInt) ->
|
||||
case scan:token(ScanState) of
|
||||
{ok, {_Location, ?T_COLON}} -> {ok, {Location, #s_local_label{number = UInt}}};
|
||||
ScanRes -> badtok("junk after symbol", ScanRes)
|
||||
end.
|
||||
|
||||
%% Seen "<symbol> <uinteger>". The <uinteger> is the <accumulator> if followed
|
||||
%% by ",", otherwise (the start of) the <displacement>.
|
||||
insn_uint(ScanState, Location, Name, UInt) ->
|
||||
|
||||
Reference in New Issue
Block a user