1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: improve comment support (#12305)

This commit is contained in:
Larpon
2021-10-26 15:58:05 +02:00
committed by GitHub
parent 52df19ef61
commit 9a3967bd7d
5 changed files with 49 additions and 18 deletions

View File

@@ -59,6 +59,9 @@ fn (mut p Parser) run_checker() ? {
scanner: p.scanner
}
chckr.check(p.root_map) ?
for comment in p.ast_root.comments {
chckr.check_comment(comment) ?
}
}
}
@@ -240,8 +243,8 @@ pub fn (mut p Parser) root_table() ? {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'parsing token "$p.tok.kind" "$p.tok.lit"')
match p.tok.kind {
.hash {
// TODO table.comments << p.comment()
c := p.comment()
p.ast_root.comments << c
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'skipping comment "$c.text"')
}
//.whitespace, .tab, .nl {