Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various changes for tools/check-typo #1287

Merged
merged 18 commits into from Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Expand Up @@ -50,7 +50,7 @@ README* ocaml-typo=missing-header


asmcomp/*/emit.mlp ocaml-typo=tab,long-line,unused-prop
asmcomp/power/NOTES.md ocaml-typo=missing-header,long-line
asmcomp/power/NOTES.md ocaml-typo=missing-header

asmrun/i386.S ocaml-typo=long-line

Expand Down Expand Up @@ -80,6 +80,7 @@ otherlibs/win32unix/symlink.c ocaml-typo=long-line
stdlib/hashbang ocaml-typo=white-at-eol,missing-lf

testsuite/tests/** ocaml-typo=missing-header
testsuite/tests/lib-unix/win-stat/fakeclock.c ocaml-typo=
testsuite/tests/lib-bigarray-2/bigarrf.f ocaml-typo=missing-header,tab
testsuite/tests/misc-unsafe/almabench.ml ocaml-typo=missing-header,long-line
testsuite/typing ocaml-typo=missing-header
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -279,6 +279,9 @@ _ocamltest
/testsuite/tests/lib-unix/win-symlink/link*
/testsuite/tests/lib-unix/win-symlink/test.txt

/testsuite/tests/lib-unix/win-symlink/link*
/testsuite/tests/lib-unix/win-symlink/test.txt

/testsuite/tests/opaque/fst/*.mli
/testsuite/tests/opaque/snd/*.mli

Expand Down
20 changes: 11 additions & 9 deletions .travis-ci.sh
Expand Up @@ -28,7 +28,7 @@ MAKE=make SHELL=dash
# (trunk) (pr branch)
# TRAVIS_CUR_HEAD TRAVIS_PR_HEAD
# | /
#
# ... ...
# | /
# TRAVIS_MERGE_BASE
#
Expand All @@ -37,7 +37,8 @@ TRAVIS_CUR_HEAD=${TRAVIS_COMMIT_RANGE%%...*}
TRAVIS_PR_HEAD=${TRAVIS_COMMIT_RANGE##*...}
case $TRAVIS_EVENT_TYPE in
# If this is not a pull request then TRAVIS_COMMIT_RANGE may be empty.
pull_request) TRAVIS_MERGE_BASE=$(git merge-base $TRAVIS_CUR_HEAD $TRAVIS_PR_HEAD);;
pull_request)
TRAVIS_MERGE_BASE=$(git merge-base $TRAVIS_CUR_HEAD $TRAVIS_PR_HEAD);;
esac

BuildAndTest () {
Expand Down Expand Up @@ -100,15 +101,16 @@ on the github pull request.
------------------------------------------------------------------------
EOF
# check that Changes has been modified
git diff $TRAVIS_MERGE_BASE..$TRAVIS_PR_HEAD --name-only --exit-code Changes > /dev/null \
&& CheckNoChangesMessage || echo pass
git diff $TRAVIS_MERGE_BASE..$TRAVIS_PR_HEAD --name-only --exit-code Changes
> /dev/null && CheckNoChangesMessage || echo pass
}

CheckNoChangesMessage () {
if test -n "$(git log --grep="[Nn]o [Cc]hange.* needed" --max-count=1 ${TRAVIS_MERGE_BASE}..${TRAVIS_PR_HEAD})"
API_URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/issues/$TRAVIS_PULL_REQUEST/labels
if test -n "$(git log --grep="[Nn]o [Cc]hange.* needed" --max-count=1 \
${TRAVIS_MERGE_BASE}..${TRAVIS_PR_HEAD})"
then echo pass
elif test -n "$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/issues/$TRAVIS_PULL_REQUEST/labels \
| grep 'no-change-entry-needed')"
elif test -n "$(curl $API_URL | grep 'no-change-entry-needed')"
then echo pass
else exit 1
fi
Expand All @@ -134,8 +136,8 @@ does *not* imply that your change is appropriately tested.
------------------------------------------------------------------------
EOF
# check that at least a file in testsuite/ has been modified
git diff $TRAVIS_MERGE_BASE..$TRAVIS_PR_HEAD --name-only --exit-code testsuite > /dev/null \
&& exit 1 || echo pass
git diff $TRAVIS_MERGE_BASE..$TRAVIS_PR_HEAD --name-only --exit-code \
testsuite > /dev/null && exit 1 || echo pass
}

case $CI_KIND in
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -54,8 +54,9 @@ approved PR, they need to be able to apply small changes to the
contributed branches themselves. Such changes include fixing
conflicts, adjusting a Changelog entry, or applying some code changes
required by the reviewers. Contributors are thus strongly advised to
check the [**Allow edits from maintainer**](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/)
flag on their PRs in the GitHub interface. Failing to do so might
check the [**Allow edits from maintainer**](
https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/
) flag on their PRs in the GitHub interface. Failing to do so might
significantly delay the inclusion of an otherwise perfectly ok
contribution.

Expand Down
7 changes: 4 additions & 3 deletions HACKING.adoc
@@ -1,4 +1,4 @@
= Hacking the compiler 🐫
= Hacking the compiler :camel:

This document is a work-in-progress attempt to provide useful
information for people willing to inspect or modify the compiler
Expand Down Expand Up @@ -58,8 +58,9 @@ newcomers. Here are various potential projects:
* http://caml.inria.fr/mantis/view_all_bug_page.php[The OCaml
bugtracker] contains reported bugs and feature requests. Some
changes that should be accessible to newcomers are marked with the
tag
http://caml.inria.fr/mantis/search.php?project_id=1&sticky_issues=1&sortby=last_updated&dir=DESC&highlight_changed=24&hide_status_id=90&tag_string=junior_job[junior_job].
tag link:++http://caml.inria.fr/mantis/search.php?
project_id=1&sticky_issues=1&sortby=last_updated&dir=DESC&highlight_changed=24&hide_status_id=90&tag_string=junior_job++[
junior_job].

* The
https://github.com/ocamllabs/compiler-hacking/wiki/Things-to-work-on[OCaml
Expand Down
112 changes: 61 additions & 51 deletions Makefile
Expand Up @@ -297,63 +297,72 @@ ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
else
BOOT_FLEXLINK_CMD = FLEXLINK_CMD="../boot/ocamlrun ../flexdll/flexlink.exe"
CAMLOPT := OCAML_FLEXLINK="boot/ocamlrun flexdll/flexlink.exe" $(CAMLOPT)
FLEXDLL_DIR=$(if $(wildcard flexdll/flexdll_*.$(O)),"+flexdll")
FLEXDLL_DIR=$(if $(wildcard flexdll/flexdll_*.$(O)),+flexdll)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis complains about this change. The value of FLEXDLL_DIR must be a string in OCaml syntax, so the quotes are needed.

Copy link
Member Author

@dra27 dra27 Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not quite this - it's a mistake in one of the macros further down. I've just pushed a fix. The issue is that FLEXDLL_DIR is non-empty then it must be a complete OCaml string (with the double quotes) but if it's empty then it should be empty - as the result goes into a string list into sys/config.mlp. The new generic SUBST macro escapes double-quotes which was what was causing the problem for this specific variable.

endif
else
FLEXDLL_DIR=
endif

# The configuration file

utils/config.ml: utils/config.mlp config/Makefile
sed -e 's|%%AFL_INSTRUMENT%%|$(AFL_INSTRUMENT)|' \
-e 's|%%ARCH%%|$(ARCH)|' \
-e 's|%%ARCMD%%|$(ARCMD)|' \
-e 's|%%ASM%%|$(ASM)|' \
-e 's|%%ASM_CFI_SUPPORTED%%|$(ASM_CFI_SUPPORTED)|' \
-e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
-e 's|%%BYTERUN%%|$(BYTERUN)|' \
-e 's|%%CC%%|$(CC)|' \
-e 's|%%CCOMPTYPE%%|$(CCOMPTYPE)|' \
-e 's|%%CC_PROFILE%%|$(CC_PROFILE)|' \
-e 's|%%OUTPUTOBJ%%|$(OUTPUTOBJ)|' \
-e 's|%%EXT_ASM%%|$(EXT_ASM)|' \
-e 's|%%EXT_DLL%%|$(EXT_DLL)|' \
-e 's|%%EXT_EXE%%|$(EXE)|' \
-e 's|%%EXT_LIB%%|$(EXT_LIB)|' \
-e 's|%%EXT_OBJ%%|$(EXT_OBJ)|' \
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
-e 's|%%FLEXLINK_FLAGS%%|$(subst \,\\,$(FLEXLINK_FLAGS))|' \
-e 's|%%FLEXDLL_DIR%%|$(FLEXDLL_DIR)|' \
-e 's|%%HOST%%|$(HOST)|' \
-e 's|%%LIBDIR%%|$(LIBDIR)|' \
-e 's|%%LIBUNWIND_AVAILABLE%%|$(LIBUNWIND_AVAILABLE)|' \
-e 's|%%LIBUNWIND_LINK_FLAGS%%|$(LIBUNWIND_LINK_FLAGS)|' \
-e 's|%%MKDLL%%|$(subst \,\\,$(MKDLL))|' \
-e 's|%%MKEXE%%|$(subst ",\\",$(subst \,\\,$(MKEXE)))|' \
-e 's|%%FLEXLINK_LDFLAGS%%|$(subst ",\\",$(subst \,\\,$(if $(LDFLAGS), -link "$(LDFLAGS)")))|' \
-e 's|%%MKMAINDLL%%|$(subst \,\\,$(MKMAINDLL))|' \
-e 's|%%MODEL%%|$(MODEL)|' \
-e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
-e 's|%%OCAMLC_CFLAGS%%|$(OCAMLC_CFLAGS)|' \
-e 's|%%OCAMLC_CPPFLAGS%%|$(OCAMLC_CPPFLAGS)|' \
-e 's|%%OCAMLOPT_CFLAGS%%|$(OCAMLOPT_CFLAGS)|' \
-e 's|%%OCAMLOPT_CPPFLAGS%%|$(OCAMLOPT_CPPFLAGS)|' \
-e 's|%%PACKLD%%|$(PACKLD)|' \
-e 's|%%PROFILING%%|$(PROFILING)|' \
-e 's|%%PROFINFO_WIDTH%%|$(PROFINFO_WIDTH)|' \
-e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
-e 's|%%FORCE_SAFE_STRING%%|$(FORCE_SAFE_STRING)|' \
-e 's|%%DEFAULT_SAFE_STRING%%|$(DEFAULT_SAFE_STRING)|' \
-e 's|%%WINDOWS_UNICODE%%|$(WINDOWS_UNICODE)|' \
-e 's|%%SYSTEM%%|$(SYSTEM)|' \
-e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
-e 's|%%TARGET%%|$(TARGET)|' \
-e 's|%%WITH_FRAME_POINTERS%%|$(WITH_FRAME_POINTERS)|' \
-e 's|%%WITH_PROFINFO%%|$(WITH_PROFINFO)|' \
-e 's|%%WITH_SPACETIME%%|$(WITH_SPACETIME)|' \
-e 's|%%ENABLE_CALL_COUNTS%%|$(ENABLE_CALL_COUNTS)|' \
-e 's|%%FLAT_FLOAT_ARRAY%%|$(FLAT_FLOAT_ARRAY)|' \
# SUBST generates the sed substitution for the variable *named* in $1
# SUBST_QUOTE does the same, adding double-quotes around non-empty strings
# (see FLEXDLL_DIR which must empty if FLEXDLL_DIR is empty but an OCaml
# string otherwise)
SUBST_ESCAPE=$(subst ",\\",$(subst \,\\,$(if $2,$2,$($1))))
SUBST=-e 's|%%$1%%|$(call SUBST_ESCAPE,$1,$2)|'
SUBST_QUOTE2=-e 's|%%$1%%|$(if $2,"$2")|'
SUBST_QUOTE=$(call SUBST_QUOTE2,$1,$(call SUBST_ESCAPE,$1,$2))
FLEXLINK_LDFLAGS=$(if $(LDFLAGS), -link "$(LDFLAGS)")
utils/config.ml: utils/config.mlp config/Makefile Makefile
sed $(call SUBST,AFL_INSTRUMENT) \
$(call SUBST,ARCH) \
$(call SUBST,ARCMD) \
$(call SUBST,ASM) \
$(call SUBST,ASM_CFI_SUPPORTED) \
$(call SUBST,BYTECCLIBS) \
$(call SUBST,BYTERUN) \
$(call SUBST,CC) \
$(call SUBST,CCOMPTYPE) \
$(call SUBST,CC_PROFILE) \
$(call SUBST,OUTPUTOBJ) \
$(call SUBST,EXT_ASM) \
$(call SUBST,EXT_DLL) \
$(call SUBST,EXE) \
$(call SUBST,EXT_LIB) \
$(call SUBST,EXT_OBJ) \
$(call SUBST,FLAMBDA) \
$(call SUBST,FLEXLINK_FLAGS) \
$(call SUBST_QUOTE,FLEXDLL_DIR) \
$(call SUBST,HOST) \
$(call SUBST,LIBDIR) \
$(call SUBST,LIBUNWIND_AVAILABLE) \
$(call SUBST,LIBUNWIND_LINK_FLAGS) \
$(call SUBST,MKDLL) \
$(call SUBST,MKEXE) \
$(call SUBST,FLEXLINK_LDFLAGS) \
$(call SUBST,MKMAINDLL) \
$(call SUBST,MODEL) \
$(call SUBST,NATIVECCLIBS) \
$(call SUBST,OCAMLC_CFLAGS) \
$(call SUBST,OCAMLC_CPPFLAGS) \
$(call SUBST,OCAMLOPT_CFLAGS) \
$(call SUBST,OCAMLOPT_CPPFLAGS) \
$(call SUBST,PACKLD) \
$(call SUBST,PROFILING) \
$(call SUBST,PROFINFO_WIDTH) \
$(call SUBST,RANLIBCMD) \
$(call SUBST,FORCE_SAFE_STRING) \
$(call SUBST,DEFAULT_SAFE_STRING) \
$(call SUBST,WINDOWS_UNICODE) \
$(call SUBST,SYSTEM) \
$(call SUBST,SYSTHREAD_SUPPORT) \
$(call SUBST,TARGET) \
$(call SUBST,WITH_FRAME_POINTERS) \
$(call SUBST,WITH_PROFINFO) \
$(call SUBST,WITH_SPACETIME) \
$(call SUBST,ENABLE_CALL_COUNTS) \
$(call SUBST,FLAT_FLOAT_ARRAY) \
$< > $@

ifeq "$(UNIX_OR_WIN32)" "unix"
Expand Down Expand Up @@ -1115,12 +1124,13 @@ endif

# Lint @since and @deprecated annotations

VERSIONS=$(shell git tag|grep '^[0-9]*.[0-9]*.[0-9]*$$'|grep -v '^[12].')
.PHONY: lintapidiff
lintapidiff:
$(MAKE) -C tools lintapidiff.opt
git ls-files -- 'otherlibs/*/*.mli' 'stdlib/*.mli' |\
grep -Ev internal\|obj\|spacetime\|stdLabels\|moreLabels |\
tools/lintapidiff.opt $(shell git tag|grep '^[0-9]*.[0-9]*.[0-9]*$$'|grep -v '^[12].')
tools/lintapidiff.opt $VERSIONS

# Make clean in the test suite

Expand Down
41 changes: 21 additions & 20 deletions appveyor_build.sh
Expand Up @@ -33,6 +33,18 @@ function run {
fi
}

function set_configuration {
cp config/m-nt.h byterun/caml/m.h
cp config/s-nt.h byterun/caml/s.h

FILE=$(pwd | cygpath -f - -m)/config/Makefile
echo "Edit $FILE to set PREFIX=$2"
sed -e "/PREFIX=/s|=.*|=$2|" \
-e "/^ *CFLAGS *=/s/\r\?$/ $3\0/" \
config/Makefile.$1 > config/Makefile
# run "Content of $FILE" cat config/Makefile
}

PREFIX=$(echo $OCAMLROOT| cygpath -f - -m)
APPVEYOR_BUILD_FOLDER=$(echo $APPVEYOR_BUILD_FOLDER| cygpath -f -)

Expand All @@ -47,22 +59,22 @@ case "$1" in
;;
msvc32-only)
# cd $APPVEYOR_BUILD_FOLDER/flexdll-0.35
# make MSVC_DETECT=0 CHAINS=msvc MSVC_FLAGS="-nologo -MD -D_CRT_NO_DEPRECATE -GS- -WX" support
# make MSVC_DETECT=0 \
# CHAINS=msvc \
# MSVC_FLAGS="-nologo -MD -D_CRT_NO_DEPRECATE -GS- -WX" \
# support
# cp flexdll*_msvc.obj "$PREFIX/bin/flexdll"

cd $APPVEYOR_BUILD_FOLDER/../build-msvc32
cp config/m-nt.h byterun/caml/m.h
cp config/s-nt.h byterun/caml/s.h

PREFIX="C:/Program Files/OCaml-msvc32"
echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/^ *CFLAGS *=/s/\r\?$/ -WX\0/" config/Makefile.msvc > config/Makefile
set_configuration msvc "C:/Program Files/OCaml-msmvc32" -WX

# Temporarily bootstrap flexdll
run "make flexdll" make flexdll
run "make world" make world
run "make runtimeopt" make runtimeopt
run "make -C otherlibs/systhreads libthreadsnat.lib" make -C otherlibs/systhreads libthreadsnat.lib
run "make -C otherlibs/systhreads libthreadsnat.lib" \
make -C otherlibs/systhreads libthreadsnat.lib

exit 0
;;
Expand All @@ -81,22 +93,11 @@ case "$1" in
# cp flexdll*_msvc64.obj "$PREFIX/bin/flexdll"
# cd ..

cp config/m-nt.h byterun/caml/m.h
cp config/s-nt.h byterun/caml/s.h

echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/^ *CFLAGS *=/s/\r\?$/ -WX\0/" config/Makefile.msvc64 > config/Makefile
#run "Content of config/Makefile" cat config/Makefile
set_configuration msvc64 "$PREFIX" -WX

cd ../build-mingw32

cp config/m-nt.h byterun/caml/m.h
cp config/s-nt.h byterun/caml/s.h

PREFIX=$(echo $OCAMLROOT2| cygpath -f - -m)
echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/^ *CFLAGS *=/s/\r\?$/ -Werror\0/" config/Makefile.mingw > config/Makefile
#run "Content of config/Makefile" cat config/Makefile
set_configuration mingw "$(echo $OCAMLROOT2| cygpath -f - -m)" -Werror

cd $APPVEYOR_BUILD_FOLDER

Expand Down
2 changes: 1 addition & 1 deletion asmcomp/interval.ml
Expand Up @@ -6,7 +6,7 @@
(* Benedikt Meurer, University of Siegen *)
(* *)
(* Copyright 2011 Lehrstuhl für Compilerbau und Softwareanalyse, *)
(* Universität Siegen. *)
(* Universität Siegen. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/interval.mli
Expand Up @@ -6,7 +6,7 @@
(* Benedikt Meurer, University of Siegen *)
(* *)
(* Copyright 2011 Lehrstuhl für Compilerbau und Softwareanalyse, *)
(* Universität Siegen. *)
(* Universität Siegen. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/linscan.ml
Expand Up @@ -6,7 +6,7 @@
(* Benedikt Meurer, University of Siegen *)
(* *)
(* Copyright 2011 Lehrstuhl für Compilerbau und Softwareanalyse, *)
(* Universität Siegen. *)
(* Universität Siegen. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/linscan.mli
Expand Up @@ -6,7 +6,7 @@
(* Benedikt Meurer, University of Siegen *)
(* *)
(* Copyright 2011 Lehrstuhl für Compilerbau und Softwareanalyse, *)
(* Universität Siegen. *)
(* Universität Siegen. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
Expand Down
8 changes: 4 additions & 4 deletions byterun/Makefile
Expand Up @@ -209,10 +209,10 @@ depend:
$(error Dependencies cannot be regenerated using the MSVC ports)
else
depend: prims.c caml/opnames.h caml/jumptbl.h caml/version.h
$(CC) -MM $(CFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.$$(O)/' > .depend
$(CC) -MM $(DFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.d.$$(O)/' >> .depend
$(CC) -MM $(IFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.i.$$(O)/' >> .depend
$(CC) -MM $(PICFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.pic.$$(O)/' >> .depend
$(CC) -MM $(CFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.$$(O)/'>.$@
$(CC) -MM $(DFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.d.$$(O)/'>>.$@
$(CC) -MM $(IFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.i.$$(O)/'>>.$@
$(CC) -MM $(PICFLAGS) $(CPPFLAGS) *.c | sed -e 's/\.o/.pic.$$(O)/'>>.$@
endif

include .depend
6 changes: 0 additions & 6 deletions otherlibs/systhreads/Makefile
Expand Up @@ -96,12 +96,6 @@ $(LIBNAME).cmxa: $(THREADS_NCOBJS)
# st_stubs_n.$(O) from the same source file st_stubs.c (it is compiled
# twice, each time with different options).

ifeq "$(TOOLCHAIN)" "msvc"
CCOUTPUT=/Fo
else
CCOUTPUT=-o
endif

st_stubs_b.$(O): st_stubs.c $(HEADER)
$(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(ROOTDIR)/byterun \
$(SHAREDCCCOMPOPTS) $(OUTPUTOBJ)$@ $<
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/lib-bigarray/change_layout.ml
Expand Up @@ -4,7 +4,7 @@ open Bigarray

let pp_sep ppf () = Format.fprintf ppf ";@ "
let print_array pp ppf a =
Format.fprintf ppf "@[<hov>⟦%a⟧@]"
Format.fprintf ppf "@[<hov>[|%a|]@]"
Format.(pp_print_list ~pp_sep pp) (Array.to_list a)

let print_index = print_array Format.pp_print_int
Expand Down