-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
105 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef DALE_FORM_PROC_QUOTE | ||
#define DALE_FORM_PROC_QUOTE | ||
|
||
namespace dale | ||
{ | ||
/*! Parse a procedure-body quote statement. | ||
* @param units The units context. | ||
* @param fn The function currently in scope. | ||
* @param block The current block. | ||
* @param node The node being parsed. | ||
* @param get_address Whether to return the address of the result. | ||
* @param prefixed_with_core (Unused by this form.) | ||
* @param pr The parse result for the response. | ||
* | ||
* This takes an arbitrary form and returns a pointer to a static | ||
* DNode representing that form. It is similar to ' in CL/Scheme, | ||
* except that there's no concept of a 'symbol' as such here. | ||
*/ | ||
bool | ||
FormProcQuoteParse(Units *units, Function *fn, llvm::BasicBlock *block, | ||
Node *node, bool get_address, bool prefixed_with_core, | ||
ParseResult *pr); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
|
||
use warnings; | ||
use strict; | ||
$ENV{"DALE_TEST_ARGS"} ||= ""; | ||
my $test_dir = $ENV{"DALE_TEST_DIR"} || "."; | ||
$ENV{PATH} .= ":."; | ||
|
||
use Data::Dumper; | ||
use Test::More tests => 3; | ||
|
||
my @res = `dalec $ENV{"DALE_TEST_ARGS"} $test_dir/t/src/quote.dt -o quote `; | ||
is_deeply(\@res, [], 'No compilation errors'); | ||
@res = `./quote`; | ||
is($?, 0, 'Program executed successfully'); | ||
|
||
chomp for @res; | ||
|
||
is_deeply(\@res, [ 'string: Yo dude' ], | ||
'Got correct results'); | ||
|
||
`rm quote`; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(import macros) | ||
(import cstdio) | ||
(import introspection) | ||
|
||
(using-namespace std.macros | ||
(def def-type-macro (macro extern (new linkage old) | ||
(qq using-namespace std.macros | ||
(def (uq new) (macro (uq linkage) (void) | ||
(q (uq old)))))))) | ||
|
||
(def-type-macro cstring extern (p (const char))) | ||
|
||
(def main (fn extern-c int (void) | ||
(def a-string (var auto (cstring) "Yo dude")) | ||
(printf "string: %s\n" a-string) | ||
0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters