forked from hjson/hjson-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for single-quoted strings and fix stringifying whitespace
Fixes hjson#18
- Loading branch information
Showing
15 changed files
with
155 additions
and
13 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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
# invalid name | ||
'''foo''': 0 | ||
} |
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 @@ | ||
{ | ||
# invalid ml-string | ||
foo : ""'text''' | ||
} |
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
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,29 @@ | ||
{ | ||
key1: a key in single quotes | ||
"key 2": a key in single quotes | ||
"key \"": a key in single quotes | ||
text: | ||
[ | ||
single quoted string | ||
'''You need quotes for escapes''' | ||
" untrimmed " | ||
"untrimmed " | ||
containing " double quotes | ||
containing " double quotes | ||
containing " double quotes | ||
'''"containing more " double quotes"''' | ||
containing ' single quotes | ||
containing ' single quotes | ||
containing ' single quotes | ||
"'containing more ' single quotes'" | ||
"'containing more ' single quotes'" | ||
"\n" | ||
" \n" | ||
"\n \n \n \n" | ||
"\t\n" | ||
] | ||
foo3a: asdf''' | ||
foo3b: "'''asdf" | ||
foo4a: "asdf'''\nasdf" | ||
foo4b: "asdf\n'''asdf" | ||
} |
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,28 @@ | ||
{ | ||
"key1": "a key in single quotes", | ||
"key 2": "a key in single quotes", | ||
"key \"": "a key in single quotes", | ||
"text": [ | ||
"single quoted string", | ||
"You need quotes\tfor escapes", | ||
" untrimmed ", | ||
"untrimmed ", | ||
"containing \" double quotes", | ||
"containing \" double quotes", | ||
"containing \" double quotes", | ||
"\"containing more \" double quotes\"", | ||
"containing ' single quotes", | ||
"containing ' single quotes", | ||
"containing ' single quotes", | ||
"'containing more ' single quotes'", | ||
"'containing more ' single quotes'", | ||
"\n", | ||
" \n", | ||
"\n \n \n \n", | ||
"\t\n" | ||
], | ||
"foo3a": "asdf'''", | ||
"foo3b": "'''asdf", | ||
"foo4a": "asdf'''\nasdf", | ||
"foo4b": "asdf\n'''asdf" | ||
} |
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,36 @@ | ||
{ | ||
# Hjson 3 allows the use of single quotes | ||
|
||
'key1': a key in single quotes | ||
'key 2': a key in single quotes | ||
'key "': a key in single quotes | ||
|
||
text: [ | ||
'single quoted string' | ||
'You need quotes\tfor escapes' | ||
' untrimmed ' | ||
'untrimmed ' | ||
'containing " double quotes' | ||
'containing \" double quotes' | ||
"containing \" double quotes" | ||
'"containing more " double quotes"' | ||
'containing \' single quotes' | ||
"containing ' single quotes" | ||
"containing \' single quotes" | ||
"'containing more ' single quotes'" | ||
"\'containing more \' single quotes\'" | ||
|
||
'\n' | ||
' \n' | ||
'\n \n \n \n' | ||
'\t\n' | ||
] | ||
|
||
# escapes/no escape | ||
|
||
foo3a: 'asdf\'\'\'' | ||
foo3b: '\'\'\'asdf' | ||
|
||
foo4a: 'asdf\'\'\'\nasdf' | ||
foo4b: 'asdf\n\'\'\'asdf' | ||
} |
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
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