remove all p.log()'s

pull/2089/head
Alexander Medvednikov 2019-09-23 23:18:55 +03:00
parent d2d75f3824
commit d74c91616f
2 changed files with 11 additions and 11 deletions

View File

@ -150,7 +150,7 @@ fn (p mut Parser) chash() {
// expand `@VROOT` `@VMOD` to absolute path // expand `@VROOT` `@VMOD` to absolute path
flag = flag.replace('@VROOT', p.vroot) flag = flag.replace('@VROOT', p.vroot)
flag = flag.replace('@VMOD', ModPath) flag = flag.replace('@VMOD', ModPath)
p.log('adding flag "$flag"') //p.log('adding flag "$flag"')
p.table.parse_cflag(flag, p.mod) p.table.parse_cflag(flag, p.mod)
return return
} }

View File

@ -154,7 +154,7 @@ fn (p &Parser) log(s string) {
fn (p mut Parser) parse(pass Pass) { fn (p mut Parser) parse(pass Pass) {
p.pass = pass p.pass = pass
p.log('\nparse() run=$p.pass file=$p.file_name tok=${p.strtok()}')// , "script_file=", script_file) //p.log('\nparse() run=$p.pass file=$p.file_name tok=${p.strtok()}')// , "script_file=", script_file)
// `module main` is not required if it's a single file program // `module main` is not required if it's a single file program
if p.is_script || p.pref.is_test { if p.is_script || p.pref.is_test {
p.mod = 'main' p.mod = 'main'
@ -275,7 +275,7 @@ fn (p mut Parser) parse(pass Pass) {
g += '; // global' g += '; // global'
p.cgen.consts << g p.cgen.consts << g
case Token.eof: case Token.eof:
p.log('end of parse()') //p.log('end of parse()')
if p.is_script && !p.pref.is_test { if p.is_script && !p.pref.is_test {
p.set_current_fn( MainFn ) p.set_current_fn( MainFn )
p.check_unused_variables() p.check_unused_variables()
@ -379,7 +379,7 @@ fn (p mut Parser) import_statement() {
if mod in p.table.imports { if mod in p.table.imports {
return return
} }
p.log('adding import $mod') //p.log('adding import $mod')
p.table.imports << mod p.table.imports << mod
p.table.register_module(mod) p.table.register_module(mod)
@ -469,7 +469,7 @@ fn (p mut Parser) interface_method(field_name, receiver string) &Fn {
is_method: true is_method: true
receiver_typ: receiver receiver_typ: receiver
} }
p.log('is interface. field=$field_name run=$p.pass') //p.log('is interface. field=$field_name run=$p.pass')
p.fn_args(mut method) p.fn_args(mut method)
if p.scanner.has_gone_over_line_end() { if p.scanner.has_gone_over_line_end() {
method.typ = 'void' method.typ = 'void'
@ -1056,7 +1056,7 @@ fn (p &Parser) print_tok() {
// statements() returns the type of the last statement // statements() returns the type of the last statement
fn (p mut Parser) statements() string { fn (p mut Parser) statements() string {
p.log('statements()') //p.log('statements()')
typ := p.statements_no_rcbr() typ := p.statements_no_rcbr()
if !p.inside_if_expr { if !p.inside_if_expr {
p.genln('}') p.genln('}')
@ -1193,7 +1193,7 @@ fn (p mut Parser) statement(add_semi bool) string {
} }
// `a := 777` // `a := 777`
else if p.peek() == .decl_assign || p.peek() == .comma { else if p.peek() == .decl_assign || p.peek() == .comma {
p.log('var decl') //p.log('var decl')
p.var_decl() p.var_decl()
} }
else { else {
@ -1752,7 +1752,7 @@ fn (p mut Parser) name_expr() string {
if f.typ == 'void' && !p.inside_if_expr { if f.typ == 'void' && !p.inside_if_expr {
// p.error('`$f.name` used as value') // p.error('`$f.name` used as value')
} }
p.log('calling function') //p.log('calling function')
p.fn_call(f, 0, '', '') p.fn_call(f, 0, '', '')
// dot after a function call: `get_user().age` // dot after a function call: `get_user().age`
if p.tok == .dot { if p.tok == .dot {
@ -1763,7 +1763,7 @@ fn (p mut Parser) name_expr() string {
} }
return typ return typ
} }
p.log('end of name_expr') //p.log('end of name_expr')
if f.typ.ends_with('*') { if f.typ.ends_with('*') {
p.is_alloc = true p.is_alloc = true
@ -1772,7 +1772,7 @@ fn (p mut Parser) name_expr() string {
} }
fn (p mut Parser) var_expr(v Var) string { fn (p mut Parser) var_expr(v Var) string {
p.log('\nvar_expr() v.name="$v.name" v.typ="$v.typ"') //p.log('\nvar_expr() v.name="$v.name" v.typ="$v.typ"')
// println('var expr is_tmp=$p.cgen.is_tmp\n') // println('var expr is_tmp=$p.cgen.is_tmp\n')
if !v.is_const { if !v.is_const {
p.mark_var_used(v) p.mark_var_used(v)
@ -1811,7 +1811,7 @@ fn (p mut Parser) var_expr(v Var) string {
} }
// println('dot #$dc') // println('dot #$dc')
typ = p.dot(typ, fn_ph) typ = p.dot(typ, fn_ph)
p.log('typ after dot=$typ') //p.log('typ after dot=$typ')
// print('tok after dot()') // print('tok after dot()')
// p.print_tok() // p.print_tok()
// dc++ // dc++