[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#790422: Parsing.Parse_error



Hi,

Quoting Joachim Breitner (2015-06-29 15:54:29)
> Am Montag, den 29.06.2015, 15:29 +0200 schrieb Johannes Schauer:
> > Firstly, there are two syntax errors in your Sources file. They are
> > "libghc-data-default-dev (<< = 0.6)" and "libghc-shakespeare-dev (<< 
> > = 2.1)".
> > Observe how the version relationship is invalid.
> 
> well spotted! I just did not see that.

me neither - I manually bisected that humongous B-D line ;)

I marginally improved the situation in the upstream git branch
user/josch/fix_debian_bug_790422 and has to be merged by Pietro.

You are now shown the line number of the problem. The character number in that
line is still missing though. :(

You can also find the fix attached as a patch. It's against upstream HEAD but
should also apply to the version in Debian as far as I can see.

Thanks!

cheers, josch
From 96cce743e589c621a2fc3a3d9becbadf9e077d40 Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Mon, 29 Jun 2015 16:11:23 +0200
Subject: [PATCH] also print line number of parse errors in deb/packages.ml

---
 deb/packages.ml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/deb/packages.ml b/deb/packages.ml
index f4fb9c7..0b0e015 100644
--- a/deb/packages.ml
+++ b/deb/packages.ml
@@ -72,8 +72,10 @@ let default_package = {
 (* here the _loc is taken from the the caller and not from the parser *)
 let lexbuf_wrapper type_parser (_loc,s) =
   try type_parser Packages_lexer.token_deb (Lexing.from_string s) 
-  with Format822.Syntax_error (_msg, _) ->
+  with
+  |Format822.Syntax_error (_msg, _) ->
    raise (Format822.Syntax_error (s, _loc))
+  | Parsing.Parse_error _ -> raise (Format822.Parse_error_822 (s, _loc))
 
 let parse_name = lexbuf_wrapper Packages_parser.pkgname_top
 let parse_version = lexbuf_wrapper Packages_parser.version_top
-- 
2.1.4

Attachment: signature.asc
Description: signature


Reply to: