diff options
author | 2021-04-20 22:59:22 -0700 | |
---|---|---|
committer | 2021-04-20 22:59:22 -0700 | |
commit | 879743110ca29ccfb180e000f50a88678077a57c (patch) | |
tree | bd6fbdf1fff28a31f52c494377fe6b8922838f50 /src/main_wasm.zig | |
parent | 49f4011a66cd29652133f3c1139241728b641d5e (diff) | |
download | bun-879743110ca29ccfb180e000f50a88678077a57c.tar.gz bun-879743110ca29ccfb180e000f50a88678077a57c.tar.zst bun-879743110ca29ccfb180e000f50a88678077a57c.zip |
waip
Diffstat (limited to 'src/main_wasm.zig')
-rw-r--r-- | src/main_wasm.zig | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main_wasm.zig b/src/main_wasm.zig index 2adcbdce5..73f03f9ad 100644 --- a/src/main_wasm.zig +++ b/src/main_wasm.zig @@ -2,6 +2,8 @@ const std = @import("std"); const lex = @import("js_lexer.zig"); const logger = @import("logger.zig"); const alloc = @import("alloc.zig"); +const options = @import("options.zig"); +const js_parser = @import("js_parser.zig"); pub fn main() anyerror!void { try alloc.setup(std.heap.page_allocator); @@ -15,17 +17,11 @@ pub fn main() anyerror!void { // // } // // alloc - const msgs = std.ArrayList(logger.Msg).init(alloc.dynamic); - const log = logger.Log{ - .msgs = msgs, - }; - const source = logger.Source.initPathString("index.js", "for (let i = 0; i < 100; i++) { console.log('hi') aposkdpoaskdpokasdpokasdpokasdpokasdpoaksdpoaksdpoaskdpoaksdpoaksdpoaskdpoaskdpoasdk; }", alloc.dynamic); + const entryPointName = "/var/foo/index.js"; + const code = "for (let i = 0; i < 100; i++) { console.log('hi') aposkdpoaskdpokasdpokasdpokasdpokasdpoaksdpoaksdpoaskdpoaksdpoaksdpoaskdpoaskdpoasdk; "; + var parser = try js_parser.Parser.init(try options.TransformOptions.initUncached(alloc.dynamic, entryPointName, code), alloc.dynamic); + var res = try parser.parse(); - var lexer = try lex.Lexer.init(log, source, alloc.dynamic); - lexer.next(); - while (lexer.token != lex.T.t_end_of_file) { - lexer.next(); - } - const v = try std.io.getStdOut().write("Finished"); + std.debug.print("{s}", .{res}); } |