aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/compiler/diameter_forms.hrl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-11-16 16:58:34 +0100
committerAnders Svensson <[email protected]>2011-12-02 16:10:27 +0100
commit371ec40cd3bbee34d954a28e5bdf86098e619ed4 (patch)
tree2ad0e12a4d5e61ddf49e589d820679412b522ce7 /lib/diameter/src/compiler/diameter_forms.hrl
parentca185011269606596814075d4c8f9d13a855866b (diff)
downloadotp-371ec40cd3bbee34d954a28e5bdf86098e619ed4.tar.gz
otp-371ec40cd3bbee34d954a28e5bdf86098e619ed4.tar.bz2
otp-371ec40cd3bbee34d954a28e5bdf86098e619ed4.zip
diameter_spec_util -> diameter_dict_util and adapt to parser
Errors are now detected after the parse with format_error/1 providing understandable error messages, pointing to the offending line number(s) in the dictionary source.
Diffstat (limited to 'lib/diameter/src/compiler/diameter_forms.hrl')
-rw-r--r--lib/diameter/src/compiler/diameter_forms.hrl7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/diameter/src/compiler/diameter_forms.hrl b/lib/diameter/src/compiler/diameter_forms.hrl
index d93131df34..4cd86c32aa 100644
--- a/lib/diameter/src/compiler/diameter_forms.hrl
+++ b/lib/diameter/src/compiler/diameter_forms.hrl
@@ -21,6 +21,13 @@
%% Macros used when building abstract code.
%%
+%% Generated functions that could have no generated clauses will have
+%% a trailing ?BADARG clause that should never execute as called
+%% by diameter.
+-define(BADARG(N), {?clause, [?VAR('_') || _ <- lists:seq(1,N)],
+ [],
+ [?APPLY(erlang, error, [?ATOM(badarg)])]}).
+
%% Form tag with line number.
-define(F(T), T, ?LINE).
%% Yes, that's right. The replacement is to the first unmatched ')'.