Created
October 13, 2014 06:47
-
-
Save VimalKumarS/87edbc6a3db3c37dcf34 to your computer and use it in GitHub Desktop.
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
Implemeted syntax parameter simillar to Scheme programming language, in Sweet.js macro. | |
Eg: | |
macro aif { | |
case { | |
$aif_name | |
($cond ...) {$tru ...} else { $els ... } | |
} => { | |
SyntaxParameter(it, $cond ... , aif , | |
return # | |
{ | |
(function () { | |
if ($cond ...) { | |
$tru ... | |
} else { | |
$els ... | |
} | |
}) | |
}) | |
} | |
} | |
== SyntaxParameter(<parameter variable>,<Assigned expression in macro>,<Scope or context>,<apply to function>) | |
File Modified | |
In parser.js, parse through the syntax and create a syntaxparam tree object that store the syntax param, corresponding value and store the scope of the macro. | |
In pattern.js- modified trascribe function | |
modifeid debug.js | |
added 3 test cases test1.js,test2.js,test3.js. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment