Skip to content

Commit eedf587

Browse files
committed
scanner: change -d debugscanner to -d trace_scanner for uniformity with the other tracing options, described in CONTRIBUTING.md
1 parent 02c0f3f commit eedf587

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,15 @@ a copy of the compiler rather than replacing it with `v self`.
273273

274274
| Flag | Usage |
275275
|-----------------------------------|---------------------------------------------------------------------------------------------------------------------|
276-
| `debugscanner` | Prints debug information during the scanning phase |
277276
| `debug_codegen` | Prints automatically generated V code during the scanning phase |
278277
| `debug_interface_table` | Prints generated interfaces during C generation |
279278
| `debug_interface_type_implements` | Prints debug information when checking that a type implements in interface |
280279
| `print_vweb_template_expansions` | Prints vweb compiled HTML files |
281280
| `time_checking` | Prints the time spent checking files and other related information |
282281
| `time_parsing` | Prints the time spent parsing files and other related information |
283282
| | |
283+
| `trace_scanner` | Prints details about the recognized tokens. *Very* verbose. Use `./vnew -no-builtin -check-syntax file.v` later. |
284284
| `trace_parser` | Prints details about parsed statements and expressions. Very verbose. Use it for panics in the parser. |
285-
| `trace_ccoptions` | Prints options passed down to the C compiler |
286-
| | |
287285
| `trace_checker` | Prints details about the statements being checked. Very verbose. Use it for panics in the checker. |
288286
| | |
289287
| `trace_gen` | Prints all the strings written to the generated C file. Very verbose. |
@@ -295,7 +293,10 @@ a copy of the compiler rather than replacing it with `v self`.
295293
| `trace_autofree` | Prints details about how/when -autofree puts free() calls |
296294
| `trace_autostr` | Prints details about `.str()` method auto-generated by the compiler during C generation |
297295
| | |
296+
| `trace_ccoptions` | Prints options passed down to the C compiler |
297+
| | |
298298
| `trace_thirdparty_obj_files` | Prints details about built thirdparty obj files |
299299
| `trace_usecache` | Prints details when -usecache is used |
300300
| `trace_embed_file` | Prints details when $embed_file is used |
301301
| `embed_only_metadata` | Embed only the metadata for the file(s) with `$embed_file('somefile')`; faster; for development, *not* distribution |
302+
|-----------------------------------|---------------------------------------------------------------------------------------------------------------------|

vlib/v/parser/parser.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4374,7 +4374,7 @@ fn (mut p Parser) top_level_statement_start() {
43744374
if p.comments_mode == .toplevel_comments {
43754375
p.scanner.set_is_inside_toplevel_statement(true)
43764376
p.rewind_scanner_to_current_token_in_new_mode()
4377-
$if debugscanner ? {
4377+
$if trace_scanner ? {
43784378
eprintln('>> p.top_level_statement_start | tidx:${p.tok.tidx:-5} | p.tok.kind: ${p.tok.kind:-10} | p.tok.lit: ${p.tok.lit} ${p.peek_tok.lit} ${p.peek_token(2).lit} ${p.peek_token(3).lit} ...')
43794379
}
43804380
}
@@ -4384,7 +4384,7 @@ fn (mut p Parser) top_level_statement_end() {
43844384
if p.comments_mode == .toplevel_comments {
43854385
p.scanner.set_is_inside_toplevel_statement(false)
43864386
p.rewind_scanner_to_current_token_in_new_mode()
4387-
$if debugscanner ? {
4387+
$if trace_scanner ? {
43884388
eprintln('>> p.top_level_statement_end | tidx:${p.tok.tidx:-5} | p.tok.kind: ${p.tok.kind:-10} | p.tok.lit: ${p.tok.lit} ${p.peek_tok.lit} ${p.peek_token(2).lit} ${p.peek_token(3).lit} ...')
43894389
}
43904390
}

vlib/v/scanner/scanner.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,9 @@ fn (mut s Scanner) scan_all_tokens_in_buffer() {
589589
}
590590
s.scan_remaining_text()
591591
s.tidx = 0
592-
$if debugscanner ? {
592+
$if trace_scanner ? {
593593
for t in s.all_tokens {
594-
eprintln('> tidx:${t.tidx:-5} | kind: ${t.kind:-10} | lit: ${t.lit}')
594+
eprintln('> tidx:${t.tidx:-5} | kind: ${t.kind:-10} | lit.len: ${t.lit.len:-5} | lit: `${t.lit}`')
595595
}
596596
}
597597
}

0 commit comments

Comments
 (0)