net.html: use `-d debug_html` instead of `-g`, prevent undesired output, while debugging user programs (#14521)
ci/woodpecker/push/vc Pipeline was successful Details
ci/woodpecker/push/docker Pipeline was successful Details
ci/woodpecker/push/arch Pipeline was successful Details

kahsa 2022-05-25 17:23:56 +09:00 committed by Jef Roosens
parent f9515f7515
commit 585cb9ec2b
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 8 additions and 11 deletions

View File

@ -21,12 +21,10 @@ mut:
debug_file os.File debug_file os.File
} }
[if debug] [if debug_html ?]
fn (mut dom DocumentObjectModel) print_debug(data string) { fn (mut dom DocumentObjectModel) print_debug(data string) {
$if debug { if data.len > 0 {
if data.len > 0 { dom.debug_file.writeln(data) or { eprintln(err) }
dom.debug_file.writeln(data) or { eprintln(err) }
}
} }
} }

View File

@ -49,12 +49,10 @@ fn (parser Parser) builder_str() string {
return parser.lexical_attributes.lexeme_builder.after(0) return parser.lexical_attributes.lexeme_builder.after(0)
} }
[if debug] [if debug_html ?]
fn (mut parser Parser) print_debug(data string) { fn (mut parser Parser) print_debug(data string) {
$if debug { if data.len > 0 {
if data.len > 0 { parser.debug_file.writeln(data) or { panic(err) }
parser.debug_file.writeln(data) or { panic(err) }
}
} }
} }
@ -155,7 +153,8 @@ pub fn (mut parser Parser) split_parse(data string) {
parser.lexical_attributes.current_tag.attributes[lattr] = nval parser.lexical_attributes.current_tag.attributes[lattr] = nval
parser.lexical_attributes.current_tag.last_attribute = '' parser.lexical_attributes.current_tag.last_attribute = ''
} else { } else {
parser.lexical_attributes.current_tag.attributes[temp_lexeme.to_lower()] = '' // parser.print_debug(temp_lexeme) parser.lexical_attributes.current_tag.attributes[temp_lexeme.to_lower()] = ''
// parser.print_debug(temp_lexeme)
} }
parser.lexical_attributes.lexeme_builder.go_back_to(0) parser.lexical_attributes.lexeme_builder.go_back_to(0)
} else { } else {