renumbers error testers basing on 5000.
All checks were successful
continuous-integration/drone/push Build is passing

fixed a compiler bug not checking the lower bound of block depth in find_variable_backward_with_word()
This commit is contained in:
hyung-hwan 2024-01-23 01:11:13 +09:00
parent 676ba7d746
commit bc7cbd9ed2
21 changed files with 89 additions and 33 deletions

View File

@ -53,7 +53,6 @@ hclgo.bin: lib/libhcl.la $(hclgo_OBJECTS)
go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod
## ---------------------------------------------------------------
go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod
rm -rf $(builddir)/go.mod $(builddir)/go.sum
## the go to o recipe is fake to deceive make
.go.o:
@ -62,6 +61,7 @@ hclgo.bin: lib/libhcl.la $(hclgo_OBJECTS)
.mod.o:
echo $< > $@
endif

View File

@ -941,7 +941,6 @@ clean-local:
@ENABLE_HCLGO_TRUE@ CGO_LDFLAGS="-L$(abs_builddir)/lib -L$(abs_builddir)/lib/.libs -lhcl -ldl -lquadmath" \
@ENABLE_HCLGO_TRUE@ go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/hclgo.bin -modfile $(abs_builddir)/go.mod
@ENABLE_HCLGO_TRUE@ go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod
@ENABLE_HCLGO_TRUE@ rm -rf $(builddir)/go.mod $(builddir)/go.sum
@ENABLE_HCLGO_TRUE@.go.o:
@ENABLE_HCLGO_TRUE@ echo $< > $@

View File

@ -409,7 +409,8 @@ HCL_INFO2 (hcl, "CLASS NAMED VAR [%.*js]\n", name->len, name->ptr);
/* the current function block accesses temporaries in an outer function block */
hcl->c->fnblk.info[hcl->c->fnblk.depth].access_outer = 1;
/* temporaries in an outer function block is accessed by the current function block */
hcl->c->fnblk.info[i - 1].accessed_by_inner = 1;
if (i > 0) hcl->c->fnblk.info[i - 1].accessed_by_inner = 1;
}
return 1;

View File

@ -81,7 +81,7 @@ func main() {
x.SetLogTarget("/dev/stderr")
}
x.SetTrait (x.GetTrait() | hcl.TRAIT_LANG_ENABLE_EOL | hcl.TRAIT_LANG_ENABLE_BLOCK)
x.SetTrait(x.GetTrait() | hcl.TRAIT_LANG_ENABLE_EOL | hcl.TRAIT_LANG_ENABLE_BLOCK)
err = x.Ignite(1000000)
if err != nil {

View File

@ -1,6 +1,7 @@
AUTOMAKE_OPTIONS = nostdinc
check_SCRIPTS = \
feed-01.hcl \
fun-01.hcl \
insta-01.hcl \
insta-02.hcl \
@ -10,19 +11,19 @@ check_SCRIPTS = \
var-02.hcl
check_ERRORS = \
call-01.err \
class-01.err \
do-01.err \
do-02.err \
feed-01.err \
feed-02.err \
feed-03.err \
feed-04.err \
mlist-01.err \
var-01.err \
var-02.err \
var-03.err \
var-04.err
call-5001.err \
class-5001.err \
do-5001.err \
do-5002.err \
feed-5001.err \
feed-5002.err \
feed-5003.err \
feed-5004.err \
mlist-5001.err \
var-5001.err \
var-5002.err \
var-5003.err \
var-5004.err
##noinst_SCRIPTS = $(check_SCRIPTS)
EXTRA_DIST = $(check_SCRIPTS) $(check_ERRORS)

View File

@ -472,6 +472,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = nostdinc
check_SCRIPTS = \
feed-01.hcl \
fun-01.hcl \
insta-01.hcl \
insta-02.hcl \
@ -481,19 +482,19 @@ check_SCRIPTS = \
var-02.hcl
check_ERRORS = \
call-01.err \
class-01.err \
do-01.err \
do-02.err \
feed-01.err \
feed-02.err \
feed-03.err \
feed-04.err \
mlist-01.err \
var-01.err \
var-02.err \
var-03.err \
var-04.err
call-5001.err \
class-5001.err \
do-5001.err \
do-5002.err \
feed-5001.err \
feed-5002.err \
feed-5003.err \
feed-5004.err \
mlist-5001.err \
var-5001.err \
var-5002.err \
var-5003.err \
var-5004.err
EXTRA_DIST = $(check_SCRIPTS) $(check_ERRORS)
TEST_EXTENSIONS = .hcl .err

54
t/feed-01.hcl Normal file
View File

@ -0,0 +1,54 @@
## this file is to test the reader/feeder againsst weirdly formatted input text.
{ ## START
| J |
defun xxx (x y z
::: r ) {
| k
b
s |
k := (+ x y z)
b := (* k k)
s := (* b b)
printf "%d %d %d\n" k b s
r := s
J := r
}
[
j
] \
:= (xxx
10
20
30)
if (eqv? j 12960000) \
{
printf "OK: j is 12960000\n"
} else {
printf "BAD: j is not 12960000\n"
}
xxx \
1 \
2 \
3
if (eqv? J 1296) {
printf "OK: J is 1296\n"
} else {
printf "BAD: J is not 1296\n"
}
} ## END

View File

@ -14,11 +14,11 @@ if (eqv? j 20) {
q := (x 30);
};
if (/= a 900) { print "ERROR: a is not 900\n" }
if (/= a 900) { print "ERROR: a is not 900\n" } \
else { printf "OK: %d\n" a };
if (/= b 60) { print "ERROR: b is not 60\n" }
if (/= b 60) { print "ERROR: b is not 60\n" } \
else { printf "OK: %d\n" b };
if (/= c 840) { print "ERROR: c is not 840\n" }
if (/= c 840) { print "ERROR: c is not 840\n" } \
else { printf "OK: %d\n" c };