Skip to content

Commit

Permalink
Permit more control characters in comments (toml-lang#924)
Browse files Browse the repository at this point in the history
Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
  • Loading branch information
3 people committed Jan 10, 2023
1 parent 913ff56 commit ab74958
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## unreleased

- Relax comment parsing; most control characters are again permitted.
- Allow newline after key/values in inline tables.
- Allow trailing comma in inline tables.
- Clarify where and how dotted keys define tables.
Expand Down
5 changes: 2 additions & 3 deletions toml.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ newline =/ %x0D.0A ; CRLF

;; Comment

comment = comment-start-symbol *allowed-comment-char
comment-start-symbol = %x23 ; #
allowed-comment-char = %x01-09 / %x0E-7F / non-ascii
non-ascii = %x80-D7FF / %xE000-10FFFF
non-eol = %x09 / %x20-7E / non-ascii

comment = comment-start-symbol *non-eol

;; Key-Value pairs

Expand Down
5 changes: 3 additions & 2 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ key = "value" # This is a comment at the end of a line
another = "# This is not a comment"
```

Control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F)
are not permitted in comments.
Comments may contain any Unicode code points except the following control codes
that could cause problems during editing or processing: U+0000, and U+000A to
U+000D.

## Key/Value Pair

Expand Down

0 comments on commit ab74958

Please sign in to comment.