diff --git a/erlang/apps/as/src/parse.erl b/erlang/apps/as/src/parse.erl index c618c77..0750ef3 100644 --- a/erlang/apps/as/src/parse.erl +++ b/erlang/apps/as/src/parse.erl @@ -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_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_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 " ". The is the if followed %% by ",", otherwise (the start of) the . insn_uint(ScanState, Location, Name, UInt) ->