fix commit "frontend/parse.c, bug fix, PPlex(.."dc1.@m1[vth][1]"..)"

which broke
  let something = foo[var]
notably used in
  examples/Monte_Carlo/MC_ring.sp
This commit is contained in:
rlar 2015-12-16 19:17:18 +01:00
parent 0b92d8cfe1
commit 876086f768
2 changed files with 11 additions and 2 deletions

View File

@ -680,8 +680,9 @@ PPlex(YYSTYPE *lvalp, struct PPltype *llocp, char **line)
atsign = 1;
else if (!atsign && *sbuf == '[')
break;
else if (atsign && *sbuf == ']') {
sbuf++;
else if (*sbuf == ']') {
if (atsign)
sbuf++;
break;
}

View File

@ -17,6 +17,9 @@ let gold = 500m
let bar = foo[2]
let baz = @v1[dc][2]
let two = 2
let argh = foo[two]
let fail_count = 0
if bar <> 0.5
@ -29,6 +32,11 @@ if baz <> 0.5
let fail_count = fail_count + 1
end
if argh <> 0.5
echo "ERROR: bar = $&argh should be 0.5"
let fail_count = fail_count + 1
end
if fail_count > 0
echo "ERROR: $&fail_count tests failed"
quit 1