Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tomhrr/dale
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhrr committed Oct 20, 2024
2 parents a3f3f77 + 6034acb commit bd27d77
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ jobs:
- uses: actions/checkout@v1
- run: sudo apt-get install build-essential llvm-14 llvm-14-dev clang-14 libedit-dev
- run: cmake -DLLVM_CONFIG=/usr/bin/llvm-config-14 . && make && make tests
build-macos-14:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- run: brew install llvm@14
- run: PATH="/usr/local/opt/llvm@14/bin:$PATH" cmake . && make -j$(nproc) && make tests
# This job appears to be running as expected, but times out before
# completion for some reason.
# build-macos-14:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v1
# - run: brew install llvm@14
# - run: PATH="/opt/homebrew/opt/llvm@14/bin:$PATH" cmake . && make -j$(nproc) && make tests
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ endif ()
execute_process (COMMAND ${LLVM_CONFIG} --libs
OUTPUT_VARIABLE LLVM_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(LLVM_LIBS NATIVE_COMMAND ${LLVM_LIBS})

if (${D_LLVM_VERSION_ORD} GREATER 34)
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
Expand Down
4 changes: 4 additions & 0 deletions modules/variant.dt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ later.)
(and (null enumnode)
(do (report-error mc name "atom required for variant name")
(return (nullptr DNode))))
(and (or (null instances)
(null (@:@ instances list-node)))
(do (report-error mc name "list required for variant members")
(return (nullptr DNode))))
(let ((lookupnode \ (prefix-token-node mc "_Lookup" name))
(struct-defs \ (create-struct-defs mc enumnode instances))
(constructors \ (create-constructors mc name instances))
Expand Down
2 changes: 1 addition & 1 deletion t/999last/001compile-errors.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ENV{"DALE_TEST_ARGS"} ||= "";
my $test_dir = $ENV{"DALE_TEST_DIR"} || ".";
$ENV{PATH} .= ":.";

use Test::More tests => 327;
use Test::More tests => 330;

my @error_files =
(@ARGV)
Expand Down
17 changes: 17 additions & 0 deletions t/error-src/variant-member.dt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(import variant)
(import macros)

(using-namespace std.macros
(def def-ordered-variant (macro intern (name cons)
(qq def-variant (uq name) cons))))

(def-ordered-variant Instr
((Doge ((a int)))
Soge
(Quoge ((a int) (b int)))))

(def main (fn extern-c
int
((argc int)
(argv (p (p char))))
(return 0)))
2 changes: 2 additions & 0 deletions t/error-src/variant-member.dt.errors
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variant-member.dt:8:22: error: list required for variant members (see macro at 6:9)
variant-member.dt:6:9: error: macro expansion error (see previous) (see macro at 8:1)

0 comments on commit bd27d77

Please sign in to comment.