mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-01-24 03:18:22 +00:00
as: parse: stmt_after_uinteger/3: move out of insn parsing block, correct diagnostic
This commit is contained in:
parent
1f89281c1e
commit
dae3d2d768
@ -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) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user