aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/epp.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-03-11 15:16:19 +0100
committerHans Bolinder <[email protected]>2014-03-24 09:13:02 +0100
commit0cd4d6babd9b5480ed3694ba8a3538447dc63a35 (patch)
tree6b7aafaa031ada7529c9135d73a12b36f186a452 /lib/stdlib/src/epp.erl
parentc2b4eab25c907f453a394d382c04cd04e6c06b49 (diff)
downloadotp-0cd4d6babd9b5480ed3694ba8a3538447dc63a35.tar.gz
otp-0cd4d6babd9b5480ed3694ba8a3538447dc63a35.tar.bz2
otp-0cd4d6babd9b5480ed3694ba8a3538447dc63a35.zip
stdlib: Add more types to epp and erl_lint
Diffstat (limited to 'lib/stdlib/src/epp.erl')
-rw-r--r--lib/stdlib/src/epp.erl30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl
index d212a55b47..9b506b0a44 100644
--- a/lib/stdlib/src/epp.erl
+++ b/lib/stdlib/src/epp.erl
@@ -33,23 +33,33 @@
-export_type([source_encoding/0]).
--type macros() :: [{atom(), term()}].
+-type macros() :: [atom() | {atom(), term()}].
-type epp_handle() :: pid().
-type source_encoding() :: latin1 | utf8.
+-type ifdef() :: 'ifdef' | 'ifndef' | 'else'.
+
+-type name() :: {'atom', atom()}.
+-type argspec() :: 'none' %No arguments
+ | non_neg_integer(). %Number of arguments
+-type tokens() :: [erl_scan:token()].
+-type used() :: {name(), argspec()}.
+
-define(DEFAULT_ENCODING, utf8).
%% Epp state record.
--record(epp, {file, %Current file
+-record(epp, {file :: file:io_device(), %Current file
location=1, %Current location
- delta, %Offset from Location (-file)
- name="", %Current file name
- name2="", %-"-, modified by -file
- istk=[], %Ifdef stack
- sstk=[], %State stack
- path=[], %Include-path
- macs = dict:new() :: dict:dict(),%Macros (don't care locations)
- uses = dict:new() :: dict:dict(),%Macro use structure
+ delta=0 :: non_neg_integer(), %Offset from Location (-file)
+ name="" :: file:name(), %Current file name
+ name2="" :: file:name(), %-"-, modified by -file
+ istk=[] :: [ifdef()], %Ifdef stack
+ sstk=[] :: [#epp{}], %State stack
+ path=[] :: [file:name()], %Include-path
+ macs = dict:new() %Macros (don't care locations)
+ :: dict:dict(name(), {argspec(), tokens()}),
+ uses = dict:new() %Macro use structure
+ :: dict:dict(name(), [{argspec(), [used()]}]),
default_encoding = ?DEFAULT_ENCODING :: source_encoding(),
pre_opened = false :: boolean()
}).