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,14 +21,12 @@ mut:
debug_file os.File
}
[if debug]
[if debug_html ?]
fn (mut dom DocumentObjectModel) print_debug(data string) {
$if debug {
if data.len > 0 {
dom.debug_file.writeln(data) or { eprintln(err) }
}
}
}
[inline]
fn is_close_tag(tag &Tag) bool {

View File

@ -49,14 +49,12 @@ fn (parser Parser) builder_str() string {
return parser.lexical_attributes.lexeme_builder.after(0)
}
[if debug]
[if debug_html ?]
fn (mut parser Parser) print_debug(data string) {
$if debug {
if data.len > 0 {
parser.debug_file.writeln(data) or { panic(err) }
}
}
}
fn (mut parser Parser) verify_end_comment(remove bool) bool {
lexeme := parser.builder_str()
@ -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.last_attribute = ''
} 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)
} else {