From 7245f90b2dd686acacb9c8ee03f5d8fb05e09aeb Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 30 Jul 2021 00:50:29 -0700 Subject: little bit of errors, little bit of bytecode caching. neither finished Former-commit-id: c774c395136d58330aa7cad7e9fa434bcef7d5c6 --- src/js_parser/js_parser.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/js_parser/js_parser.zig') diff --git a/src/js_parser/js_parser.zig b/src/js_parser/js_parser.zig index 5ee6eab94..a987351c7 100644 --- a/src/js_parser/js_parser.zig +++ b/src/js_parser/js_parser.zig @@ -1,5 +1,19 @@ usingnamespace @import("imports.zig"); +// Dear reader, +// There are some things you should know about this file to make it easier for humans to read +// "P" is the internal parts of the parser +// "p.e" allocates a new Expr +// "p.b" allocates a new Binding +// "p.s" allocates a new Stmt +// We do it this way so if we want to refactor how these are allocated in the future, we only have to modify one function to change it everywhere +// Everything in JavaScript is either an Expression, a Binding, or a Statement. +// Expression: foo(1) +// Statement: let a = 1; +// Binding: 1 +// While the names for Expr, Binding, and Stmt are directly copied from esbuild, those were likely inspired by Go's parser. +// which is another example of a very fast parser. + const TemplatePartTuple = std.meta.Tuple(&[_]type{ []E.TemplatePart, logger.Loc }); const ScopeOrderList = std.ArrayListUnmanaged(?ScopeOrder); -- cgit v1.2.3