mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-01-24 11:22:52 +00:00
as: tunit.erl: add missing -spec:s
This commit is contained in:
parent
c1bd54af52
commit
c6c6aeeee4
@ -31,20 +31,25 @@
|
||||
|
||||
%% API -------------------------------------------------------------------------
|
||||
|
||||
-spec new() -> #tunit{}.
|
||||
new() ->
|
||||
#tunit{ sections = #{}
|
||||
, cursect = false
|
||||
, symbols = #{}
|
||||
}.
|
||||
|
||||
-spec get_section(#tunit{}, string()) -> #section{} | false.
|
||||
get_section(#tunit{sections = Sections}, Name) ->
|
||||
maps:get(Name, Sections, false).
|
||||
|
||||
-spec put_section(#tunit{}, #section{}) -> #tunit{}.
|
||||
put_section(Tunit = #tunit{sections = Sections}, Section) ->
|
||||
Tunit#tunit{sections = maps:put(Section#section.name, Section, Sections)}.
|
||||
|
||||
-spec get_symbol(#tunit{}, string()) -> #symbol{} | false.
|
||||
get_symbol(#tunit{symbols = Symbols}, Name) ->
|
||||
maps:get(Name, Symbols, false).
|
||||
|
||||
-spec put_symbol(#tunit{}, #symbol{}) -> #tunit{}.
|
||||
put_symbol(Tunit = #tunit{symbols = Symbols}, Symbol) ->
|
||||
Tunit#tunit{symbols = maps:put(Symbol#symbol.name, Symbol, Symbols)}.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user