Skip to content

Commit

Permalink
refs #320 fixed nested list parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnich committed Feb 4, 2016
1 parent 94c1c71 commit f2074fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions doxygen/lang/900_release_notes.dox.tmpl
Expand Up @@ -427,8 +427,9 @@
- fixed a bug where @ref Qore::HTTPClient::get() and @ref Qore::HTTPClient::post() would try to retrieve a message body even if <tt>Content-Length: 0</tt> was returned (or if no \c Content-Length header was returned at all) which would result in a deadlock until the server would close the connection (<a href="https://github.com/qorelanguage/qore/issues/434">bug 434</a>)
- fixed a bug where regular expression substitution would go into an infinite loop when used with an empty pattern and the global flag (@ref Qore::RE_Global, <a href="https://github.com/qorelanguage/qore/issues/329">bug 329</a>)
- fixed a bug with connection handling in the @ref Qore::SQL::SQLStatement "SQLStatement" class; an exception is now thrown if a @ref Qore::SQL::SQLStatement "SQLStatement" object tries to execute its prepared SQL on a connection other than the original connection used to prepare the statement (<a href="https://github.com/qorelanguage/qore/issues/465">bug 465</a>)
- fixed a bug where @ref Qore::is_executable() would return NOTHING instead of False (as per documentation) when called with non-existent path as it's parameter
- fixed precedence of logical and bitwise \ref operators
- fixed a bug where @ref Qore::is_executable() would return NOTHING instead of False (as per documentation) when called with non-existent path as it's parameter (<a href="https://github.com/qorelanguage/qore/issues/470">bug 470</a>)
- fixed precedence of logical and bitwise \ref operators (<a href="https://github.com/qorelanguage/qore/issues/481">bug 481</a>)
- fixed a bug where nested lists were not parsed correctly in some cases (<a href="https://github.com/qorelanguage/qore/issues/320">bug 320</a>)

@section qore_0811 Qore 0.8.11

Expand Down
15 changes: 6 additions & 9 deletions examples/test/qore/operators/list_ops.qtest
Expand Up @@ -60,10 +60,9 @@ class Test inherits QUnit::Test {
}

pushEmptyListToEmptyList() {
#list l = ();
#broken, see issue #320
#assertEq(((),), push l, ());
#assertEq(((),), l);
list l = ();
assertEq(((),), push l, ());
assertEq(((),), l);
}

pushElementToNothing() {
Expand Down Expand Up @@ -120,10 +119,9 @@ class Test inherits QUnit::Test {
}

unshiftEmptyListToEmptyList() {
#list l = ();
#broken, see issue #320
#assertEq(((),), unshift l, ());
#assertEq(((),), l);
list l = ();
assertEq(((),), unshift l, ());
assertEq(((),), l);
}

unshiftElementToNothing() {
Expand Down Expand Up @@ -154,7 +152,6 @@ class Test inherits QUnit::Test {
assertThrows("UNSHIFT-ERROR", sub() { unshift l4, 3; });
}


popBasics() {
list l = (1, 2);
assertEq(2, pop l);
Expand Down
8 changes: 7 additions & 1 deletion lib/parser.ypp
Expand Up @@ -2717,8 +2717,14 @@ list:
{ $$ = splice_expressions($1, $3); }
| exp ',' {
QoreListNode* l;
if ($1 && $1->getType() == NT_LIST)
if ($1 && $1->getType() == NT_LIST) {
l = reinterpret_cast<QoreListNode*>($1);
if (l->isFinalized()) {
QoreListNode* nl = new QoreListNode;
nl->push(l);
l = nl;
}
}
else {
l = new QoreListNode;
l->push($1);
Expand Down

0 comments on commit f2074fb

Please sign in to comment.