From 7129f2acb474651fa4ef922b24ff18dd84dd9c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 4 Dec 2014 15:03:39 +0100 Subject: asn1ct_parser2: Clean up error handling and reporting Errors were reported using a throw like this: throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module), [got,get_token(hd(Tokens)),expected,typereference]}}). The attempt to tell the user what was expected was often mis-leading. It is time-consuming and non-trival to provide correct information of what is expected. Therefore, we will not even try. Instead we will spend more effort to report the token where the error was discovered. We will replace each throw with a function call: parse_error(Tokens). Also add the syntax_SUITE test suite to test error reporting and to cover all error reporting code. Remove the old c_syntax/1 test case. Also remove all out-commented code. --- lib/asn1/src/asn1ct_check.erl | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/asn1/src/asn1ct_check.erl') diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 7ed7da2ae7..23794f789a 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -527,8 +527,6 @@ check_class(S = #state{mname=M,tname=T},ClassSpec) end; check_class(S, #objectclass{}=C) -> check_objectclass(S, C); -check_class(_S,{poc,_ObjSet,_Params}) -> - 'fix this later'; check_class(S,ClassName) -> {RefMod,Def} = get_referenced_type(S,ClassName), case Def of -- cgit v1.2.3