diff --git a/CHANGELOG_NEXT.md b/CHANGELOG_NEXT.md index f6c3865cc98..ce5919b8451 100644 --- a/CHANGELOG_NEXT.md +++ b/CHANGELOG_NEXT.md @@ -49,6 +49,9 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO * The compiler now supports `impossible` in a non-case lambda. You can now write `\ Refl impossible`. +* The compiler now parses `~x.fun` as unquoting `x` rather than `x.fun` + and `~(f 5).fun` as unquoting `(f 5)` rather than `(f 5).fun`. + ### Backend changes #### RefC Backend diff --git a/Makefile b/Makefile index 36556d36a81..1e828cf8817 100644 --- a/Makefile +++ b/Makefile @@ -158,7 +158,7 @@ test: testenv @echo "NOTE: \`${MAKE} test\` does not rebuild Idris or the libraries packaged with it; to do that run \`${MAKE}\`" @if [ ! -x "${TARGET}" ]; then echo "ERROR: Missing IDRIS2 executable. Cannot run tests!\n"; exit 1; fi @echo - @${MAKE} -C tests only=$(only) except=$(except) IDRIS2=${TARGET} IDRIS2_PREFIX=${TEST_PREFIX} + @${MAKE} -C tests only=$(only) except=$(except) IDRIS2=${TARGET} IDRIS2_PREFIX=${TEST_PREFIX} CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" retest: testenv diff --git a/config.mk b/config.mk index f15620db59f..8372535ef74 100644 --- a/config.mk +++ b/config.mk @@ -36,6 +36,12 @@ else SHLIB_SUFFIX := .so endif +# Find homebrew's libgmp on ARM macs +ifneq (,$(wildcard ${HOMEBREW_PREFIX}/include/gmp.h)) + CPPFLAGS += -I${HOMEBREW_PREFIX}/include + LDFLAGS += -L${HOMEBREW_PREFIX}/lib +endif + ifneq (, $(findstring freebsd, $(MACHINE))) CFLAGS += -I$(shell /sbin/sysctl -n user.localbase)/include LDFLAGS += -L$(shell /sbin/sysctl -n user.localbase)/lib diff --git a/src/Idris/Parser.idr b/src/Idris/Parser.idr index f566523c495..4d07f893c90 100644 --- a/src/Idris/Parser.idr +++ b/src/Idris/Parser.idr @@ -631,7 +631,7 @@ mutual decoratedSymbol fname "]" pure ts pure (PQuoteDecl (boundToFC fname b) (collectDefs (concat b.val))) - <|> do b <- bounds (decoratedSymbol fname "~" *> simpleExpr fname indents) + <|> do b <- bounds (decoratedSymbol fname "~" *> simplerExpr fname indents) pure (PUnquote (boundToFC fname b) b.val) <|> do start <- bounds (symbol "(") bracketedExpr fname start indents diff --git a/tests/idris2/error/perror031/Issue3251.idr b/tests/idris2/error/perror031/Issue3251.idr new file mode 100644 index 00000000000..7f37a1f549e --- /dev/null +++ b/tests/idris2/error/perror031/Issue3251.idr @@ -0,0 +1,19 @@ +import Language.Reflection + +(.fun) : Nat -> Nat + +x : TTImp + +f : Nat -> TTImp + +useX : TTImp +useX = `(g (~x).fun) + +useX' : TTImp +useX' = `(g ~x.fun) + +useFX : TTImp +useFX = `(g (~(f 5)).fun) + +useFX' : TTImp +useFX' = `(g ~(f 5).fun) diff --git a/tests/idris2/error/perror031/expected b/tests/idris2/error/perror031/expected new file mode 100644 index 00000000000..53ff9b0ca7a --- /dev/null +++ b/tests/idris2/error/perror031/expected @@ -0,0 +1 @@ +1/1: Building Issue3251 (Issue3251.idr) diff --git a/tests/idris2/error/perror031/run b/tests/idris2/error/perror031/run new file mode 100644 index 00000000000..345a367bb33 --- /dev/null +++ b/tests/idris2/error/perror031/run @@ -0,0 +1,3 @@ +. ../../../testutils.sh + +check Issue3251.idr diff --git a/tests/refc/ccompilerArgs/run b/tests/refc/ccompilerArgs/run index e91a9c1ef04..ef84ccaefda 100755 --- a/tests/refc/ccompilerArgs/run +++ b/tests/refc/ccompilerArgs/run @@ -20,8 +20,8 @@ cd ./library/ make > /dev/null cd .. -export CFLAGS="-I./library/ -O3" -export LDFLAGS="-L./library/ -Wl,-S" +export CFLAGS="-I./library/ -O3 ${CFLAGS}" +export LDFLAGS="-L./library/ -Wl,-S ${LDFLAGS}" export LDLIBS="-lexternalc" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./library/" export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:./library/"