diff --git a/src/newick.js b/src/newick.js index 43715e6..326488a 100644 --- a/src/newick.js +++ b/src/newick.js @@ -83,7 +83,7 @@ break; default: var x = tokens[i-1]; - if (x == ')' || x == '(' || x == ',') { + if (i==0 || x == ')' || x == '(' || x == ',') { tree.name = token; } else if (x == ':') { tree.length = parseFloat(token);