From 44d6f54d6782d63a25d80f6d920d67adb33bda52 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Tue, 5 Oct 2010 14:08:59 +0300 Subject: syntax_tools: Add types to record definitions --- lib/syntax_tools/src/erl_syntax_lib.erl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/syntax_tools/src/erl_syntax_lib.erl') diff --git a/lib/syntax_tools/src/erl_syntax_lib.erl b/lib/syntax_tools/src/erl_syntax_lib.erl index 4808971a59..daef74e874 100644 --- a/lib/syntax_tools/src/erl_syntax_lib.erl +++ b/lib/syntax_tools/src/erl_syntax_lib.erl @@ -1134,21 +1134,21 @@ collect_attribute(_, {N, V}, Info) -> %% Abstract datatype for collecting module information. --record(forms, {module, exports, module_imports, imports, attributes, - records, errors, warnings, functions, rules}). +-record(forms, {module = none :: 'none' | {'value', atom()}, + exports = [] :: [{atom(), arity()}], + module_imports = [] :: [atom()], + imports = [] :: [{atom(), [{atom(), arity()}]}], + attributes = [] :: [{atom(), term()}], + records = [] :: [{atom(), [{atom(), field_default()}]}], + errors = [] :: [term()], + warnings = [] :: [term()], + functions = [] :: [{atom(), arity()}], + rules = [] :: [{atom(), arity()}]}). + +-type field_default() :: 'none' | erl_syntax:syntaxTree(). new_finfo() -> - #forms{module = none, - exports = [], - module_imports = [], - imports = [], - attributes = [], - records = [], - errors = [], - warnings = [], - functions = [], - rules = [] - }. + #forms{}. finfo_set_module(Name, Info) -> case Info#forms.module of -- cgit v1.2.3