forked from perl11/potion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compile: add Source class for the c compiler, light EXEC_COMPILE refa…
…ctor
- Loading branch information
Reini Urban
committed
May 10, 2013
1 parent
94ef67c
commit 4031053
Showing
4 changed files
with
60 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Source = class(source|opts=S): /source = source, /opts = opts. | ||
|
||
# optionally transform ast | ||
# no methods for the various ast types, as we have no ast types yet :) | ||
# TODO: support method combinations? before, after, around | ||
#SourceBlock compile :after = (): . | ||
|
||
# the walker | ||
#Source compile :after = (): | ||
# "compilec" /opts join say | ||
# /source. | ||
|
||
# the emitter | ||
# dump c code for compiled ast | ||
Source dumpc = (source|opts=S): | ||
/source = source | ||
/opts = opts | ||
"dumpc" opts join say | ||
source string. | ||
|
||
1 |