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

The whole string was lexed into only one TOK_STR
  instead of the actual (quasi) identifier "dc1.@m1[vth]"
This commit is contained in:
rlar
2015-09-24 18:25:25 +02:00
parent 192eeadb0b
commit a5f933b3ec
4 changed files with 63 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
TESTS = bugs-1.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir
TESTS = bugs-1.cir bugs-2.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir
TESTS_ENVIRONMENT = ngspice_vpath=$(srcdir) $(SHELL) $(top_srcdir)/tests/bin/check.sh $(top_builddir)/src/ngspice
+42
View File
@@ -0,0 +1,42 @@
parser test
*
* test capability to parse @foo[bar][42]
* (exec-spice "ngspice %s" t)
v1 1 0 dc=0
.control
save @v1[dc]
dc v1 0 1 250m
let foo = @v1[dc]
let gold = 500m
let bar = foo[2]
let baz = @v1[dc][2]
let fail_count = 0
if bar <> 0.5
echo "ERROR: bar = $&bar should be 0.5"
let fail_count = fail_count + 1
end
if baz <> 0.5
echo "ERROR: baz = $&baz should be 0.5"
let fail_count = fail_count + 1
end
if fail_count > 0
echo "ERROR: $&fail_count tests failed"
quit 1
else
echo "INFO: $&fail_count tests failed"
quit 0
end
.endc
.end
+8
View File
@@ -0,0 +1,8 @@
Circuit: parser test
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
No. of Data Rows : 5
INFO: 0 tests failed