Skip to content

Commit

Permalink
fix(util): do not consume leading slash (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronNemo authored Jul 23, 2024
1 parent 2e5b85f commit a529713
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hjson/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where
self.eat_char();
}
Some(_) => {
self.eat_char();
return Ok(());
}
None => return Err(self.error(ErrorCode::TrailingCharacters)), //todo
}
Expand Down
2 changes: 2 additions & 0 deletions hjson_tests/assets/comments_result.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
str1: 00 # part of the string
str2: 00.0 // part of the string
str3: 02 /* part of the string */
/key: value
key2: /value2
}
4 changes: 3 additions & 1 deletion hjson_tests/assets/comments_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
"null3": null,
"str1": "00 # part of the string",
"str2": "00.0 // part of the string",
"str3": "02 /* part of the string */"
"str3": "02 /* part of the string */",
"/key": "value",
"key2": "/value2"
}
2 changes: 2 additions & 0 deletions hjson_tests/assets/comments_test.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ styles
str1: 00 # part of the string
str2: 00.0 // part of the string
str3: 02 /* part of the string */
/key: value
key2: /value2
}

0 comments on commit a529713

Please sign in to comment.