Skip to content

Commit

Permalink
Merge branch 'main' into impossible-lam
Browse files Browse the repository at this point in the history
  • Loading branch information
dunhamsteve committed Apr 27, 2024
2 parents b99dd05 + 84ce3a6 commit 37e1cbd
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Idris/Parser.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions tests/idris2/error/perror031/Issue3251.idr
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tests/idris2/error/perror031/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1/1: Building Issue3251 (Issue3251.idr)
3 changes: 3 additions & 0 deletions tests/idris2/error/perror031/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
. ../../../testutils.sh

check Issue3251.idr
4 changes: 2 additions & 2 deletions tests/refc/ccompilerArgs/run
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit 37e1cbd

Please sign in to comment.