-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ini/toml): Support comments on the same line. (#2039)
- Loading branch information
1 parent
d8808e9
commit 7af498f
Showing
9 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<span class="hljs-comment"># Comment</span> | ||
<span class="hljs-comment">; ini-style comment</span> | ||
<span class="hljs-attr">x</span> = <span class="hljs-string">"abc"</span> <span class="hljs-comment"># Comment on same line</span> | ||
<span class="hljs-attr">y</span> = <span class="hljs-number">123</span> <span class="hljs-comment">; Comment on same line</span> | ||
<span class="hljs-section">[table]</span> <span class="hljs-comment">; Comment on same line</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Comment | ||
; ini-style comment | ||
x = "abc" # Comment on same line | ||
y = 123 ; Comment on same line | ||
[table] ; Comment on same line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span class="hljs-section">[table]</span> | ||
<span class="hljs-section">[[array]]</span> | ||
<span class="hljs-section">[dotted.table.name]</span> | ||
<span class="hljs-section">[target.'cfg(unix)']</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[table] | ||
[[array]] | ||
[dotted.table.name] | ||
[target.'cfg(unix)'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<span class="hljs-attr">i</span> = <span class="hljs-number">1_234</span> | ||
<span class="hljs-attr">f</span> = <span class="hljs-number">1.23</span> | ||
<span class="hljs-attr">f</span> = <span class="hljs-number">7</span>e+<span class="hljs-number">12</span> | ||
<span class="hljs-attr">f</span> = <span class="hljs-number">2</span>e3 | ||
<span class="hljs-attr">f</span> = -<span class="hljs-number">1.234</span>e-<span class="hljs-number">12</span> | ||
<span class="hljs-attr">basic</span> = <span class="hljs-string">"string"</span> | ||
<span class="hljs-attr">multi_basic</span> = <span class="hljs-string">"""multiple | ||
lines"""</span> | ||
<span class="hljs-attr">literal</span> = <span class="hljs-string">'string'</span> | ||
<span class="hljs-attr">multi_literal</span> = <span class="hljs-string">'''multiple | ||
lines'''</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">true</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">false</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">on</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">off</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">yes</span> | ||
<span class="hljs-attr">b</span> = <span class="hljs-literal">no</span> | ||
<span class="hljs-attr">dotted.key</span> = <span class="hljs-number">1</span> | ||
<span class="hljs-attr">array</span> = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>] | ||
<span class="hljs-attr">inline</span> = {name = <span class="hljs-string">"foo"</span>, id = <span class="hljs-number">123</span>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
i = 1_234 | ||
f = 1.23 | ||
f = 7e+12 | ||
f = 2e3 | ||
f = -1.234e-12 | ||
basic = "string" | ||
multi_basic = """multiple | ||
lines""" | ||
literal = 'string' | ||
multi_literal = '''multiple | ||
lines''' | ||
b = true | ||
b = false | ||
b = on | ||
b = off | ||
b = yes | ||
b = no | ||
dotted.key = 1 | ||
array = [1, 2, 3] | ||
inline = {name = "foo", id = 123} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span class="hljs-attr">memory_limit</span> = <span class="hljs-variable">${PHP_MEMORY_LIMIT}</span> | ||
<span class="hljs-attr">key</span> = <span class="hljs-variable">$VAR1</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
memory_limit = ${PHP_MEMORY_LIMIT} | ||
key = $VAR1 |