Skip to content

Commit 16a0458

Browse files
committed
1 parent 64a9478 commit 16a0458

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/parser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,13 @@ module.exports = function(engine) {
374374
* list ::= separator? ( item separator )* item
375375
* </ebnf>
376376
*/
377-
,read_list: function(item, separator) {
377+
,read_list: function(item, separator, preserveFirstSeparator) {
378378
var result = [];
379379

380-
// trim first separator (@fixme not sure ?)
381-
if (this.token == separator) this.next();
380+
if (this.token == separator) {
381+
if (preserveFirstSeparator) result.push('');
382+
this.next();
383+
}
382384

383385
if (typeof (item) === "function") {
384386
do {

src/parser/namespace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function(api, tokens, EOF) {
4242
* </ebnf>
4343
*/
4444
,read_namespace_name: function() {
45-
return this.read_list(tokens.T_STRING, tokens.T_NS_SEPARATOR);
45+
return this.read_list(tokens.T_STRING, tokens.T_NS_SEPARATOR, true);
4646
}
4747
/**
4848
* <ebnf>

0 commit comments

Comments
 (0)