12 lines
271 B
C#
12 lines
271 B
C#
namespace Compilers {
|
|
public class JS {
|
|
public static string Compile(Ast.Expr source) {
|
|
return "process.stdout.write(String("
|
|
+ source.Match(
|
|
Int: i => i.ToString(),
|
|
String: s => $"'{s.ToString()}'"
|
|
)
|
|
+ "));";
|
|
}
|
|
}
|
|
} |