aboutsummaryrefslogtreecommitdiff
path: root/src/main_wasm.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-19 20:53:54 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-19 20:53:54 -0700
commit5ae24b75aec557136058e227a45f3662b7e36f9f (patch)
tree42d8d6c8211f13d13eef50be43abfa05cf5f4e78 /src/main_wasm.zig
parent17df86ca17e9a16d6dfee1767877f25c45e28e91 (diff)
downloadbun-5ae24b75aec557136058e227a45f3662b7e36f9f.tar.gz
bun-5ae24b75aec557136058e227a45f3662b7e36f9f.tar.zst
bun-5ae24b75aec557136058e227a45f3662b7e36f9f.zip
lots
Diffstat (limited to 'src/main_wasm.zig')
-rw-r--r--src/main_wasm.zig31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main_wasm.zig b/src/main_wasm.zig
new file mode 100644
index 000000000..2adcbdce5
--- /dev/null
+++ b/src/main_wasm.zig
@@ -0,0 +1,31 @@
+const std = @import("std");
+const lex = @import("js_lexer.zig");
+const logger = @import("logger.zig");
+const alloc = @import("alloc.zig");
+
+pub fn main() anyerror!void {
+ try alloc.setup(std.heap.page_allocator);
+ // const args = try std.process.argsAlloc(alloc.dynamic);
+ // // const stdout = std.io.getStdOut();
+ // // const stderr = std.io.getStdErr();
+
+ // // if (args.len < 1) {
+ // // const len = stderr.write("Pass a file");
+ // // return;
+ // // }
+
+ // // 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);
+
+ 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");
+}