net.html: use `-d debug_html` instead of `-g`, prevent undesired output, while debugging user programs (#14521)

master
kahsa 2022-05-25 17:23:56 +09:00 committed by GitHub
parent 31c234485a
commit dd8c96f6bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View File

@ -21,13 +21,11 @@ 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) }
} }
}
} }
[inline] [inline]

View File

@ -49,13 +49,11 @@ 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) }
} }
}
} }
fn (mut parser Parser) verify_end_comment(remove bool) bool { fn (mut parser Parser) verify_end_comment(remove bool) bool {
@ -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 {