fix(encoding/toml): fix comment line starting with whitespaces (#1017)

This commit is contained in:
Fuji Haruka 2021-07-13 23:16:45 +09:00 committed by GitHub
parent eca63fc779
commit 6649e0abc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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!

View File

@ -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) {