Skip to content

Commit

Permalink
Support extern(C++ <strings>) with trailing comma
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 authored and dlang-bot committed Jul 16, 2020
1 parent 311e4d4 commit f9a8284
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dparse/ast.d
Original file line number Diff line number Diff line change
Expand Up @@ -3739,7 +3739,7 @@ unittest // issue #398: Support extern(C++, <string expressions...>)
assert(ns.length == 1);
checkText(ns[0], `"foo"`);

ns = getNamespaces(`extern(C++, "foo", "bar", "baz") int i;`);
ns = getNamespaces(`extern(C++, "foo", "bar", "baz",) int i;`);
assert(ns.length == 3);
checkText(ns[0], `"foo"`);
checkText(ns[1], `"bar"`);
Expand Down
4 changes: 2 additions & 2 deletions src/dparse/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -4864,13 +4864,13 @@ class Parser
* Parses a NamespaceList.
*
* $(GRAMMAR $(RULEDEF namespaceList):
* $(RULE ternaryExpression) ($(LITERAL ',') $(RULE ternaryExpression)?)*
* $(RULE ternaryExpression) ($(LITERAL ',') $(RULE ternaryExpression)?)* $(LITERAL ',')?
* ;)
*/
NamespaceList parseNamespaceList()
{
mixin(traceEnterAndExit!(__FUNCTION__));
return parseCommaSeparatedRule!(NamespaceList, TernaryExpression)();
return parseCommaSeparatedRule!(NamespaceList, TernaryExpression)(true);
}

/**
Expand Down

0 comments on commit f9a8284

Please sign in to comment.