Parse comparisons correctly

Fixes #129
This commit is contained in:
tjvr 2016-04-19 09:44:54 +01:00
parent 29146842ad
commit 3d9ce9d7a8
2 changed files with 12 additions and 1 deletions

View file

@ -395,7 +395,7 @@ var scratchblocks = function () {
if (tok === '<' || (tok === '>' && end === '>')) {
var last = children[children.length - 1];
var c = peekNonWs();
if (last && last.isInput && (c === '[' || c === '(' || c === '<')) {
if (last && !last.isLabel && (c === '[' || c === '(' || c === '<' || c === '{')) {
label = null;
children.push(new Label(tok));
next();

11
tests/lt-gt.txt Normal file
View file

@ -0,0 +1,11 @@
<[10]<(bar)>
<[10]<[11]>
<(foo)<(bar)>
<(foo)<[11]>
<[10]>(bar)>
<[10]>[11]>
<(foo)>(bar)>
<(foo)>[11]>
<<><<>>
<<>><>>