-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
6e9f570
commit 36a2f1a
Showing
7 changed files
with
45 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package hxpy; | ||
|
||
@:buildXml("<include name='${haxelib:hxpy}/hxpy/Build.xml' />") | ||
@:include("Python.h") | ||
@:native("Py_ssize_t") | ||
@:scalar @:coreType @:notNull | ||
extern abstract PySsizeT from(Int) to(Int) {} |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
-D analyzer-optimize | ||
-main Main | ||
--cpp bin | ||
--library hxpy | ||
--library hxpy | ||
--macro CopyFile.run() |
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,6 @@ | ||
def multiply(a,b): | ||
print("Will compute", a, "times", b) | ||
c = 0 | ||
for i in range(0, a): | ||
c = c + b | ||
return c |
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,18 @@ | ||
package; | ||
|
||
import haxe.macro.Expr; | ||
import haxe.macro.Compiler; | ||
import sys.io.File; | ||
import sys.FileSystem; | ||
|
||
class CopyFile { | ||
public static macro function run():Expr { | ||
var outputDir:String = Compiler.getOutput(); | ||
if(!FileSystem.exists(outputDir)){ | ||
FileSystem.createDirectory(outputDir); | ||
} | ||
File.copy("multiply.py", '${outputDir}/multiply.py'); | ||
|
||
return macro a; | ||
} | ||
} |
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