00:10:58  * gettychanged nick to Getty
00:27:19  <trungl-bot>Tree opened by [email protected]: Tree is open (Automatic: \(・ω・)/)
00:45:45  * plutoniixjoined
01:49:12  * sustainedjoined
01:50:05  <sustained>I'm trying to find a tool to allow me to view the output of the v8 lexer but I'm struggling. I've found an npm package called recast which generates an AST of arbitary JS but I want to also see what things look like before the AST is constructed.
01:50:33  <sustained>Maybe my search terms are just bad but I'm struggling to find anything on Google.
02:12:06  <caitp>sustained: you could add a token printer and call it every time the next token is scanned
02:12:33  <caitp>there isn't really another way, the stream isn't tokenized before parsing, it's tokenized during parsing
02:15:02  <sustained>I don't think I'd even know where to begin.
02:15:16  <sustained>I was just hoping to gain a better understanding of the various stages of parsing and I like JS so.
02:17:42  <caitp>it shouldn't be too hard, you'd just associate each token defined in src/parser/token.h with a string indicating the token name (a lot of them already have string representations, but might be confusing to read, and not all of them do)
02:18:07  <caitp>the token enum is declared with macros, so you can do it easily by writing a macro to tokenize each token name
02:18:56  <caitp>then just adding a PrintF() call in Scanner::Next()
02:19:26  <caitp>build that, run parser-shell or something, and it should spit out all the parsed tokens in order to your terminal
02:20:04  <sustained>I'm not so good... like, at all, with C(++). I guess I should find some other way, perhaps use another programming language that is able to make the lexer output available.
02:20:14  <sustained>But thanks anyway!
02:20:25  <caitp>well, it would be about 10 minutes of work, but alright, good luck
02:20:45  <sustained>I don't have time to learn C (yet) but maybe I'll add it to my list!
02:20:54  <sustained>As I plan to, eventually.
02:21:50  <caitp>maybe Rust can do it? I think I recall the rust compiler's parser module having some interesting tools like that
02:22:08  <caitp>been a few years since I've looked at it though
02:23:28  <sustained>Rust is also on my RADAR. The issue is, I'd like to view the lexer output for a language I /already know/ because it's to gain an understanding in order to help me with my assignment and I just don't have time but this is really off-topic. Hopefully Python or /something/ is able to do what I need.
02:33:15  <caitp>well, in practice most of these implementations only do what they need to do, and printing out a stream of tokens is generally not on the list of requirements
02:33:32  <caitp>that doesn't mean no engine does it, but I'm not sure of any that do
02:34:17  <caitp>so you'd probably need to do some very slight modifications to source code to get them to do what you want. Honestly, it wouldn't be very complicated
02:42:18  <caitp>sustained: something like this ought to do it for you, https://gist.github.com/caitp/440049dbc4bac6880434fd4d04d39a85
02:42:26  <caitp>pretty minor changes to make
09:47:00  * hferreirojoined
11:41:37  * plutoniixquit (Quit: Leaving)
12:26:23  * sustainedquit (Quit: I Retire Chat)
12:27:02  * rmcilroyjoined
14:39:19  * xaxxonjoined
14:41:47  * xaxxonquit (Client Quit)
15:21:08  * bradleymeckjoined
15:23:43  * jugglinmikejoined
15:25:08  * zvquit (Ping timeout: 244 seconds)
15:25:32  * jugglinmikepart
15:41:31  * zvjoined
15:51:51  * seventhjoined
16:10:28  * hferreiroquit (Quit: Connection closed for inactivity)
16:19:37  * hferreirojoined
16:44:11  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "compile" on http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20nosnap%20-%20shared/builds/17586 "V8 Win32 - nosnap - shared" from ecea1d1911c21eda905894698982f5ee23ecc020: [email protected])
16:45:16  * bradleymeckquit (Quit: bradleymeck)
17:04:37  * bradleymeckjoined
17:07:26  * bradleymeckquit (Client Quit)
17:08:22  <trungl-bot>Tree opened by [email protected]: Open
17:08:36  * bradleymeckjoined
17:15:42  * bradleymeckquit (Ping timeout: 246 seconds)
17:16:25  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "compile" on http://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/13709 "V8 Win64 - debug" from 2d3d66ab6410dd79eb9653301314abf271a174de: [email protected])
17:17:03  * bradleymeckjoined
17:19:03  * bradleymeckquit (Client Quit)
17:35:19  * RT|Chatzillaquit (Quit: ChatZilla 0.9.86.1 [Firefox 2.0.0.22pre/2010030309])
17:36:59  * bradleymeckjoined
17:51:30  * bradleymeckquit (Quit: bradleymeck)
19:04:40  * zvquit (Ping timeout: 252 seconds)
19:37:20  <trungl-bot>Tree opened by [email protected]: Tree is open (Is the problem real?)
19:42:23  * dagobert________changed nick to dagobert_
19:42:36  * dagobert_changed nick to dagobert__
19:46:45  * seventhquit (Ping timeout: 248 seconds)
20:04:30  <trungl-bot>Tree closed by [email protected]: Tree is closed (Automatic: "compile" on http://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/13711 "V8 Win64 - debug" from f5d373b0125eb7e88ae0e7360f0d78ce5fb5a762: [email protected])
21:28:38  * zvjoined
23:56:52  * RT|Chatzillajoined