mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
fix(encoding/toml): fix comment line starting with whitespaces (#1017)
This commit is contained in:
parent
eca63fc779
commit
6649e0abc9
1
encoding/testdata/comment.toml
vendored
1
encoding/testdata/comment.toml
vendored
@ -1,4 +1,5 @@
|
||||
# This is a full-line comment
|
||||
# Comment line starting with whitespaces (#823 case 3) foo = "..."
|
||||
str0 = 'value' # This is a comment at the end of a line
|
||||
str1 = "# This is not a comment" # but this is
|
||||
str2 = """ # this is not a comment!
|
||||
|
@ -64,7 +64,7 @@ class Parser {
|
||||
|
||||
_removeComments(): void {
|
||||
function isFullLineComment(line: string) {
|
||||
return line.match(/^#/) ? true : false;
|
||||
return line.match(/^[ \t]*#/) ? true : false;
|
||||
}
|
||||
|
||||
function stringStart(line: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user