Changeset: 7b42c1960c5c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b42c1960c5c
Modified Files:
monetdb5/mal/Tests/parseErrors.stable.err
monetdb5/mal/Tests/tst002.stable.err
monetdb5/mal/Tests/tst008.stable.err
monetdb5/mal/Tests/tst054.stable.err
monetdb5/mal/Tests/tst058.stable.err
monetdb5/mal/Tests/tst163.stable.err
monetdb5/mal/Tests/tst900.stable.err
monetdb5/mal/mal_parser.c
Branch: malerrors
Log Message:
Approve output
diffs (155 lines):
diff --git a/monetdb5/mal/Tests/parseErrors.stable.err
b/monetdb5/mal/Tests/parseErrors.stable.err
--- a/monetdb5/mal/Tests/parseErrors.stable.err
+++ b/monetdb5/mal/Tests/parseErrors.stable.err
@@ -16,10 +16,10 @@ MAPI = (monetdb) /var/tmp/mtest-13954/.
QUERY = K := :=
io.print(1);
io.print(2);
-ERROR = !SyntaxException:parseError:parseError:K := :=
- !SyntaxException:parseError:parseError: ^Type identifier expected
- !SyntaxException:parseError:parseError:K := :=
- !SyntaxException:parseError:parseError: ^';' expected
+ERROR = !SyntaxException:parseError:K := :=
+ !SyntaxException:parseError: ^Type identifier expected
+ !SyntaxException:parseError:K := :=
+ !SyntaxException:parseError: ^';' expected
# 21:00:37 >
# 21:00:37 > "Done."
diff --git a/monetdb5/mal/Tests/tst002.stable.err
b/monetdb5/mal/Tests/tst002.stable.err
--- a/monetdb5/mal/Tests/tst002.stable.err
+++ b/monetdb5/mal/Tests/tst002.stable.err
@@ -38,10 +38,10 @@ QUERY = # reserved names may not be used
b:= true;
b:= false;
exit barrier;
-ERROR = !SyntaxException:parseError:parseError: true:= 23;
- !SyntaxException:parseError:parseError: ^<identifier> expected
- !SyntaxException:parseError:parseError: false:= 24;
- !SyntaxException:parseError:parseError: ^<identifier> expected
+ERROR = !SyntaxException:parseError: true:= 23;
+ !SyntaxException:parseError: ^<identifier> expected
+ !SyntaxException:parseError: false:= 24;
+ !SyntaxException:parseError: ^<identifier> expected
# 22:10:35 >
# 22:10:35 > "Done."
diff --git a/monetdb5/mal/Tests/tst008.stable.err
b/monetdb5/mal/Tests/tst008.stable.err
--- a/monetdb5/mal/Tests/tst008.stable.err
+++ b/monetdb5/mal/Tests/tst008.stable.err
@@ -36,8 +36,8 @@ QUERY = function foo();
io.printi;
io.print(i);
end foo;
-ERROR = !SyntaxException:parseError:parseError:io.printi;
- !SyntaxException:parseError:parseError: ^'(' expected
+ERROR = !SyntaxException:parseError:io.printi;
+ !SyntaxException:parseError: ^'(' expected
# 10:46:01 >
diff --git a/monetdb5/mal/Tests/tst054.stable.err
b/monetdb5/mal/Tests/tst054.stable.err
--- a/monetdb5/mal/Tests/tst054.stable.err
+++ b/monetdb5/mal/Tests/tst054.stable.err
@@ -76,8 +76,8 @@ QUERY = function z()( :int,:int,:int,:in
return (1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0);
end z;
z();
-ERROR = !SyntaxException:parseError:parseError:return
(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0);
- !SyntaxException:parseError:parseError: ^<identifier> expected
+ERROR = !SyntaxException:parseError:return
(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0);
+ !SyntaxException:parseError: ^<identifier> expected
!TypeException:user.main[1]:'user.z' undefined in: user.z();
# 11:11:08 >
diff --git a/monetdb5/mal/Tests/tst058.stable.err
b/monetdb5/mal/Tests/tst058.stable.err
--- a/monetdb5/mal/Tests/tst058.stable.err
+++ b/monetdb5/mal/Tests/tst058.stable.err
@@ -75,14 +75,14 @@ MAPI = (monetdb) /var/tmp/mtest-7831/.s
QUERY = -- some typos
i:= 1 + 1 + 1;
j:= 1 + + 1;
-ERROR = !SyntaxException:parseError:parseError:-- some typos
- !SyntaxException:parseError:parseError:^convertConstant: integer parse
error
- !SyntaxException:parseError:parseError:i:= 1 + 1 + 1;
- !SyntaxException:parseError:parseError:^<identifier> expected
- !SyntaxException:parseError:parseError:i:= 1 + 1 + 1;
- !SyntaxException:parseError:parseError: ^';' expected
- !SyntaxException:parseError:parseError:j:= 1 + + 1;
- !SyntaxException:parseError:parseError: ^<term> expected
+ERROR = !SyntaxException:parseError:-- some typos
+ !SyntaxException:parseError:^convertConstant: integer parse error
+ !SyntaxException:parseError:i:= 1 + 1 + 1;
+ !SyntaxException:parseError:^<identifier> expected
+ !SyntaxException:parseError:i:= 1 + 1 + 1;
+ !SyntaxException:parseError: ^';' expected
+ !SyntaxException:parseError:j:= 1 + + 1;
+ !SyntaxException:parseError: ^<term> expected
!TypeException:user.main[3]:'calc.+' undefined in: j:any :=
calc.+(1:int);
# 20:18:21 >
diff --git a/monetdb5/mal/Tests/tst163.stable.err
b/monetdb5/mal/Tests/tst163.stable.err
--- a/monetdb5/mal/Tests/tst163.stable.err
+++ b/monetdb5/mal/Tests/tst163.stable.err
@@ -20,10 +20,10 @@ QUERY = #multiple atomary types
j:= i+3;
io.print(i);
io.print(j);
-ERROR = !SyntaxException:parseError:parseError:atom myint:int;
- !SyntaxException:parseError:parseError: ^Atom redefinition
- !SyntaxException:parseError:parseError:i:= 1:myint;
- !SyntaxException:parseError:parseError:^';' expected
+ERROR = !SyntaxException:parseError:atom myint:int;
+ !SyntaxException:parseError: ^Atom redefinition
+ !SyntaxException:parseError:i:= 1:myint;
+ !SyntaxException:parseError:^';' expected
# 15:19:56 >
# 15:19:56 > "Done."
diff --git a/monetdb5/mal/Tests/tst900.stable.err
b/monetdb5/mal/Tests/tst900.stable.err
--- a/monetdb5/mal/Tests/tst900.stable.err
+++ b/monetdb5/mal/Tests/tst900.stable.err
@@ -41,10 +41,10 @@ QUERY = # the multiplex code blocks. Tes
end;
mdb.List("user","foo");
user.foo();
-ERROR = !SyntaxException:parseError:parseError:d:= [+](b,c) ;;# parser bug
- !SyntaxException:parseError:parseError: ^operator expected
- !SyntaxException:parseError:parseError:a:= b [+] b;
- !SyntaxException:parseError:parseError: ^operator expected
+ERROR = !SyntaxException:parseError:d:= [+](b,c) ;;# parser bug
+ !SyntaxException:parseError: ^operator expected
+ !SyntaxException:parseError:a:= b [+] b;
+ !SyntaxException:parseError: ^operator expected
# 12:36:20 >
# 12:36:20 > "Done."
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -75,13 +75,12 @@ parseError(Client cntxt, str msg)
{
MalBlkPtr mb = cntxt->curprg->def;
char *old, *new;
- char buf[1028];
+ char buf[1028]={0};
char *s = buf, *t, *line="", *marker="";
char *l = lastline(cntxt);
ssize_t i;
- snprintf(buf,1028,"parseError:");
- s= buf + strlen(buf);
+ s= buf;
for (t = l; *t && *t != '\n' && s < buf+sizeof(buf)-4; t++) {
*s++ = *t;
}
@@ -90,8 +89,7 @@ parseError(Client cntxt, str msg)
line = createException( SYNTAX, "parseError", "%s", buf);
/* produce the position marker*/
- snprintf(buf,1028,"parseError:");
- s= buf + strlen(buf);
+ s= buf;
i = position(cntxt);
for (; i > 0 && s < buf+sizeof(buf)-4; i--) {
*s++ = ((l && *(l + 1) && *l++ != '\t')) ? ' ' : '\t';
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list