diff options
author | Björn Gustavsson <[email protected]> | 2014-12-04 15:03:39 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-01-12 12:22:57 +0100 |
commit | 7129f2acb474651fa4ef922b24ff18dd84dd9c77 (patch) | |
tree | b81530ce37bec432b7256e176554646b6d55058e /lib/asn1/test/asn1_SUITE_data/InfObj.asn | |
parent | 4247459eded419b9e693cfbfaf8746f4f6f60d2c (diff) | |
download | otp-7129f2acb474651fa4ef922b24ff18dd84dd9c77.tar.gz otp-7129f2acb474651fa4ef922b24ff18dd84dd9c77.tar.bz2 otp-7129f2acb474651fa4ef922b24ff18dd84dd9c77.zip |
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.
Diffstat (limited to 'lib/asn1/test/asn1_SUITE_data/InfObj.asn')
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/InfObj.asn | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/InfObj.asn b/lib/asn1/test/asn1_SUITE_data/InfObj.asn index aef20451cb..3b88770d78 100644 --- a/lib/asn1/test/asn1_SUITE_data/InfObj.asn +++ b/lib/asn1/test/asn1_SUITE_data/InfObj.asn @@ -463,4 +463,23 @@ Contents TYPE-IDENTIFIER ::= { ContentType ::= TYPE-IDENTIFIER.&id({Contents}) id-content-type ContentType ::= { 2 7 8 9 } +-- +-- Tricky parsing of simplified syntax. +-- + +TrickyType-1 ::= BIT STRING +TrickyType-2 ::= OCTET STRING + +TRICKY ::= CLASS { + &Type1, + &Type2 +} WITH SYNTAX { + TYPE &Type1 &Type2 +} + +tricky-object TRICKY ::= {TYPE TrickyType-1 TrickyType-2} + +tricky-bit-string tricky-object.&Type1 ::= '1011'B +tricky-octet-string tricky-object.&Type1 ::= 'CAFE'H + END |