aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2015-11-24 13:46:36 +0100
committerBernhard Schommer <bschommer@users.noreply.github.com>2015-11-24 13:46:36 +0100
commit373b7e7d2ef35d7d07070abc28680b48cbb307d9 (patch)
tree58cd1f5a65aa25964a148fe10d029ce3a786a217
parent11fb68d03dd24bd875b58c5c33ca34017411b646 (diff)
parent7044b2f8319fb82111639ee7ced2966f297e59b8 (diff)
downloadcompcert-kvx-373b7e7d2ef35d7d07070abc28680b48cbb307d9.tar.gz
compcert-kvx-373b7e7d2ef35d7d07070abc28680b48cbb307d9.zip
Merge pull request #76 from fpottier/cut
A fix in the column numbers. A change in one error message.
-rw-r--r--cparser/ErrorReports.ml4
-rw-r--r--cparser/handcrafted.messages1
2 files changed, 3 insertions, 2 deletions
diff --git a/cparser/ErrorReports.ml b/cparser/ErrorReports.ml
index a8976e42..3e46365d 100644
--- a/cparser/ErrorReports.ml
+++ b/cparser/ErrorReports.ml
@@ -233,7 +233,7 @@ let fragments text checkpoint (message : string) : string =
let report text buffer checkpoint : string =
(* Extract the position where the error occurred, that is, the start
position of the invalid token. We display it as a filename, a (1-based)
- line number, and a (0-based) column number. *)
+ line number, and a (1-based) column number. *)
let (pos, _) = last buffer in
(* Construct a readable description of where the error occurred, that is,
after which token and before which token. *)
@@ -256,7 +256,7 @@ let report text buffer checkpoint : string =
Printf.sprintf "%s:%d:%d: syntax error %s.\n%s"
pos.pos_fname
pos.pos_lnum
- (pos.pos_cnum - pos.pos_bol)
+ (pos.pos_cnum - pos.pos_bol + 1)
where
message
diff --git a/cparser/handcrafted.messages b/cparser/handcrafted.messages
index 97f69617..11c26560 100644
--- a/cparser/handcrafted.messages
+++ b/cparser/handcrafted.messages
@@ -1277,6 +1277,7 @@ translation_unit_file: INT PRE_NAME VAR_NAME EQ LPAREN PRE_NAME VAR_NAME SEMICOL
# can be continued with a comma and another expression.
# So, let's just say a closing parenthesis is expected.
+Ill-formed expression.
Up to this point, an expression has been recognized:
$0
If this expression is complete,