diff options
author | Björn Gustavsson <[email protected]> | 2014-10-09 12:44:48 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-01-12 11:40:24 +0100 |
commit | 6b10f918a4445d990152e4a31f8fde5cc9c8906a (patch) | |
tree | 3c293050e1e3a368b5900e2601870e53cb190fdf /lib/asn1/src/asn1_records.hrl | |
parent | 369aebd67933c8f45cdd5feec360aace190ef019 (diff) | |
download | otp-6b10f918a4445d990152e4a31f8fde5cc9c8906a.tar.gz otp-6b10f918a4445d990152e4a31f8fde5cc9c8906a.tar.bz2 otp-6b10f918a4445d990152e4a31f8fde5cc9c8906a.zip |
Provide more reliable location of errors
File names and line number information was not reliable available
when producing error messages. Some items have embedded line number
information, and sometimes the S#state.type and/or S#state.value
could be used to retrieve the line number information.
To make sure that we can always retrieve at least an approximate
error location, store the top-level construct being checked in
S#state.error_context. Example of top-level constructs:
Seq ::= SEQUENCE {...}
i INTEGER ::= 42
This is a short-term solution. In the long term, we would want the
parser to include line number information in all items.
Diffstat (limited to 'lib/asn1/src/asn1_records.hrl')
-rw-r--r-- | lib/asn1/src/asn1_records.hrl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/asn1/src/asn1_records.hrl b/lib/asn1/src/asn1_records.hrl index 6c1cf1b12a..24f4eabe38 100644 --- a/lib/asn1/src/asn1_records.hrl +++ b/lib/asn1/src/asn1_records.hrl @@ -81,9 +81,22 @@ module :: atom(), val :: atom()}). --record(state,{module,mname,type,tname,value,vname,erule,parameters=[], - inputmodules,abscomppath=[],recordtopname=[],options, - sourcedir}). +-record(state, + {module, + mname, + type, + tname, + value, + vname, + erule, + parameters=[], + inputmodules, + abscomppath=[], + recordtopname=[], + options, + sourcedir, + error_context %Top-level thingie (contains line numbers) + }). %% state record used by back-end at partial decode %% active is set to 'yes' when a partial decode function is generated. |