mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
tools: support setting another SCANNER_MODE=parse_comments in parser_speed.v and scanner_speed.v
This commit is contained in:
parent
135e2f1cc6
commit
3e8c53568d
2 changed files with 9 additions and 1 deletions
|
@ -8,8 +8,12 @@ import v.scanner
|
||||||
import term
|
import term
|
||||||
|
|
||||||
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
||||||
|
const comments_mode = scanner.CommentsMode.from(os.getenv('SCANNER_MODE')) or {
|
||||||
|
scanner.CommentsMode.skip_comments
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
dump(comments_mode)
|
||||||
files := os.args#[1..]
|
files := os.args#[1..]
|
||||||
if files.len > 0 && files[0].starts_with('@') {
|
if files.len > 0 && files[0].starts_with('@') {
|
||||||
lst_path := files[0].all_after('@')
|
lst_path := files[0].all_after('@')
|
||||||
|
|
|
@ -5,8 +5,12 @@ import v.scanner
|
||||||
import v.pref
|
import v.pref
|
||||||
|
|
||||||
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
const skip_tests = os.getenv_opt('SKIP_TESTS') or { '' }.bool()
|
||||||
|
const comments_mode = scanner.CommentsMode.from(os.getenv('SCANNER_MODE')) or {
|
||||||
|
scanner.CommentsMode.skip_comments
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
dump(comments_mode)
|
||||||
files := os.args#[1..]
|
files := os.args#[1..]
|
||||||
if files.len > 0 && files[0].starts_with('@') {
|
if files.len > 0 && files[0].starts_with('@') {
|
||||||
lst_path := files[0].all_after('@')
|
lst_path := files[0].all_after('@')
|
||||||
|
@ -47,7 +51,7 @@ fn process_files(files []string) ! {
|
||||||
}
|
}
|
||||||
total_files++
|
total_files++
|
||||||
sw.restart()
|
sw.restart()
|
||||||
s := scanner.new_scanner_file(f, .skip_comments, pref_)!
|
s := scanner.new_scanner_file(f, comments_mode, pref_)!
|
||||||
f_us := sw.elapsed().microseconds()
|
f_us := sw.elapsed().microseconds()
|
||||||
total_us += f_us
|
total_us += f_us
|
||||||
total_bytes += s.text.len
|
total_bytes += s.text.len
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue