2
2
3
3
exports [` AST code generation > code 1` ] = `
4
4
"const resource = {
5
- \\ " hi\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " hi there!\\ " }},
6
- \\ " nested\\ " : {
7
- \\ " hello\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " hello world!\\ " }},
8
- \\ " more\\ " : {
9
- \\ " plural\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :1 ,\\ " c \\ " :[{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :6 ,\\ " k \\ " :{\\ " t \\ " :9 ,\\ " v \\ " :\\ " no apples\\ " },\\ " m \\ " :{\\ " t \\ " :8 ,\\ " v \\ " :\\ " caml\\ " }}]},{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :5 ,\\ " i \\ " :0 },{\\ " t \\ " :3 ,\\ " v \\ " :\\ " apple\\ " }]},{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :4 ,\\ " k \\ " :\\ " n \\ " },{\\ " t \\ " :3 ,\\ " v \\ " :\\ " apples\\ " }]}]}}
5
+ " hi" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " hi there!" }},
6
+ " nested" : {
7
+ " hello" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " hello world!" }},
8
+ " more" : {
9
+ " plural" : {" t " :0 ," b " :{" t " :1 ," c " :[{" t " :2 ," i " :[{" t " :6 ," k " :{" t " :9 ," v " : " no apples" }," m " :{" t " :8 ," v " : " caml" }}]},{" t " :2 ," i " :[{" t " :5 ," i " :0 },{" t " :3 ," v " : " apple" }]},{" t " :2 ," i " :[{" t " :4 ," k " : " n " },{" t " :3 ," v " : " apples" }]}]}}
10
10
},
11
- \\ " list\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 ,\\ " v \\ " :\\ " hi, \\ " },{\\ " t \\ " :5 ,\\ " i \\ " :0 },{\\ " t \\ " :3 ,\\ " v \\ " :\\ " !\\ " }]}}
11
+ " list" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 ," v " : " hi, " },{" t " :5 ," i " :0 },{" t " :3 ," v " : " !" }]}}
12
12
},
13
- \\ " こんにちは\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " こんにちは!\\ " }},
14
- \\ " single-quote\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " I don\\\\ u0027t know!\\ " }},
15
- \\ " emoji\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " 😺 \\ " }},
16
- \\ " unicode\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " A \\ " }},
17
- \\ " unicode-escape\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " \\\\\\\\ u0041\\ " }},
18
- \\ " backslash-single-quote\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " \\\\\\\\\\\\ u0027\\ " }},
19
- \\ " backslash-backslash\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " \\\\\\\\\\ \\\\\\\\" }},
20
- \\ " errors\\ " : [
21
- {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " ERROR1001\\ " }},
22
- {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " ERROR1002\\ " }},
13
+ " こんにちは" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " こんにちは!" }},
14
+ " single-quote" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " I don\\ u0027t know!" }},
15
+ " emoji" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " 😺 " }},
16
+ " unicode" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " A " }},
17
+ " unicode-escape" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " \\\\ u0041" }},
18
+ " backslash-single-quote" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " \\\\\\ u0027" }},
19
+ " backslash-backslash" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " \\\\\\\\ " }},
20
+ " errors" : [
21
+ {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " ERROR1001" }},
22
+ {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " ERROR1002" }},
23
23
24
24
],
25
- \\ " complex\\ " : {
26
- \\ " warnings\\ " : [
27
- {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 }],\\ " s \\ " :\\ " NOTE: This is warning\\ " }},
25
+ " complex" : {
26
+ " warnings" : [
27
+ {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 }]," s " : " NOTE: This is warning" }},
28
28
{
29
- \\ " named-waring\\ " : {\\ " t \\ " :0 ,\\ " b \\ " :{\\ " t \\ " :2 ,\\ " i \\ " :[{\\ " t \\ " :3 ,\\ " v \\ " :\\ " this is \\ " },{\\ " t \\ " :4 ,\\ " k \\ " :\\ " type\\ " },{\\ " t \\ " :3 ,\\ " v \\ " :\\ " warining\\ " }]}}
29
+ " named-waring" : {" t " :0 ," b " :{" t " :2 ," i " :[{" t " :3 ," v " : " this is " },{" t " :4 ," k " : " type" },{" t " :3 ," v " : " warining" }]}}
30
30
}
31
31
]
32
32
}
@@ -36,31 +36,31 @@ export default resource"
36
36
37
37
exports [` json5 > code 1` ] = `
38
38
"const resource = {
39
- \\ " hi\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " hi there!\\ " ])};fn .source = \\ " hi there!\\ " ;return fn ;})(),
40
- \\ " nested\\ " : {
41
- \\ " hello\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " hello world!\\ " ])};fn .source = \\ " hello world!\\ " ;return fn ;})(),
42
- \\ " more\\ " : {
43
- \\ " plural\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize, linked : _linked, type : _type, interpolate : _interpolate, list : _list, named : _named, plural : _plural } = ctx ;return _plural ([_normalize ([_linked (\\ " no apples\\ " , \\ " caml\\ " , _type )]), _normalize ([_interpolate (_list (0 )), \\ " apple\\ " ]), _normalize ([_interpolate (_named (\\ " n \\ " )), \\ " apples\\ " ])])};fn .source = \\ " @.caml:{'no apples'} | {0} apple | {n} apples\\ " ;return fn ;})()
39
+ " hi" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" hi there!" ])};fn .source = " hi there!" ;return fn ;})(),
40
+ " nested" : {
41
+ " hello" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" hello world!" ])};fn .source = " hello world!" ;return fn ;})(),
42
+ " more" : {
43
+ " plural" : (()=> {const fn= (ctx ) => {const { normalize : _normalize, linked : _linked, type : _type, interpolate : _interpolate, list : _list, named : _named, plural : _plural } = ctx ;return _plural ([_normalize ([_linked (" no apples" , " caml" , _type )]), _normalize ([_interpolate (_list (0 )), " apple" ]), _normalize ([_interpolate (_named (" n " )), " apples" ])])};fn .source = " @.caml:{'no apples'} | {0} apple | {n} apples" ;return fn ;})()
44
44
},
45
- \\ " list\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize, interpolate : _interpolate, list : _list } = ctx ;return _normalize ([\\ " hi, \\ " , _interpolate (_list (0 )), \\ " !\\ " ])};fn .source = \\ " hi, {0} !\\ " ;return fn ;})()
45
+ " list" : (()=> {const fn= (ctx ) => {const { normalize : _normalize, interpolate : _interpolate, list : _list } = ctx ;return _normalize ([" hi, " , _interpolate (_list (0 )), " !" ])};fn .source = " hi, {0} !" ;return fn ;})()
46
46
},
47
- \\ " こんにちは\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " こんにちは!\\ " ])};fn .source = \\ " こんにちは!\\ " ;return fn ;})(),
48
- \\ " single-quote\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " I don't know!\\ " ])};fn .source = \\ " I don't know!\\ " ;return fn ;})(),
49
- \\ " emoji\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " 😺 \\ " ])};fn .source = \\ " 😺 \\ " ;return fn ;})(),
50
- \\ " unicode\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " A \\ " ])};fn .source = \\ " A \\ " ;return fn ;})(),
51
- \\ " unicode-escape\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " \\\\\\\\ u0041\\ " ])};fn .source = \\ " \\\\\\\\ u0041\\ " ;return fn ;})(),
52
- \\ " backslash-single-quote\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " \\\\\\\\ ' \\ " ])};fn .source = \\ " \\\\\\\\ ' \\ " ;return fn ;})(),
53
- \\ " backslash-backslash\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " \\\\\\\\\\\\\\\\\\ " ])};fn .source = \\ " \\\\\\\\\\ \\\\\\\\" ;return fn ;})(),
54
- \\ " errors\\ " : [
55
- (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " ERROR1001\\ " ])};fn .source = \\ " ERROR1001\\ " ;return fn ;})(),
56
- (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " ERROR1002\\ " ])};fn .source = \\ " ERROR1002\\ " ;return fn ;})(),
47
+ " こんにちは" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" こんにちは!" ])};fn .source = " こんにちは!" ;return fn ;})(),
48
+ " single-quote" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" I don't know!" ])};fn .source = " I don't know!" ;return fn ;})(),
49
+ " emoji" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" 😺 " ])};fn .source = " 😺 " ;return fn ;})(),
50
+ " unicode" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" A " ])};fn .source = " A " ;return fn ;})(),
51
+ " unicode-escape" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" \\\\ u0041" ])};fn .source = " \\\\ u0041" ;return fn ;})(),
52
+ " backslash-single-quote" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" \\\\ ' " ])};fn .source = " \\\\ ' " ;return fn ;})(),
53
+ " backslash-backslash" : (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" \\\\\\\\ " ])};fn .source = " \\\\\\\\ " ;return fn ;})(),
54
+ " errors" : [
55
+ (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" ERROR1001" ])};fn .source = " ERROR1001" ;return fn ;})(),
56
+ (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" ERROR1002" ])};fn .source = " ERROR1002" ;return fn ;})(),
57
57
58
58
],
59
- \\ " complex\\ " : {
60
- \\ " warnings\\ " : [
61
- (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([\\ " NOTE: This is warning\\ " ])};fn .source = \\ " NOTE: This is warning\\ " ;return fn ;})(),
59
+ " complex" : {
60
+ " warnings" : [
61
+ (()=> {const fn= (ctx ) => {const { normalize : _normalize } = ctx ;return _normalize ([" NOTE: This is warning" ])};fn .source = " NOTE: This is warning" ;return fn ;})(),
62
62
{
63
- \\ " named-waring\\ " : (()=> {const fn= (ctx ) => {const { normalize : _normalize, interpolate : _interpolate, named : _named } = ctx ;return _normalize ([\\ " this is \\ " , _interpolate (_named (\\ " type\\ " )), \\ " warining\\ " ])};fn .source = \\ " this is {type} warining\\ " ;return fn ;})()
63
+ " named-waring" : (()=> {const fn= (ctx ) => {const { normalize : _normalize, interpolate : _interpolate, named : _named } = ctx ;return _normalize ([" this is " , _interpolate (_named (" type" )), " warining" ])};fn .source = " this is {type} warining" ;return fn ;})()
64
64
}
65
65
]
66
66
}
@@ -86,9 +86,9 @@ exports[`json5 > map 1`] = `
86
86
" I don't know!" ,
87
87
" 😺" ,
88
88
" A" ,
89
- " \\\\ u0041" ,
90
- " \\\\ '" ,
91
- " \\\\\\\\ " ,
89
+ " \\ u0041" ,
90
+ " \\ '" ,
91
+ " \\\\ " ,
92
92
" ERROR1001" ,
93
93
" ERROR1002" ,
94
94
" NOTE: This is warning" ,
@@ -101,30 +101,30 @@ exports[`json5 > map 1`] = `
101
101
],
102
102
" sourcesContent" : [
103
103
" {
104
- hi : \\ " hi there!\\ " ,
104
+ hi : " hi there!" ,
105
105
nested : {
106
- hello: \\ " hello world!\\ " ,
106
+ hello: " hello world!" ,
107
107
more: {
108
- plural: \\ " @.caml:{'no apples'} | {0} apple | {n} apples\\ "
108
+ plural: " @.caml:{'no apples'} | {0} apple | {n} apples"
109
109
},
110
- list: \\ " hi, {0} !\\ "
110
+ list: " hi, {0} !"
111
111
},
112
112
// comment
113
- \\ " こんにちは\\ " : \\ " こんにちは!\\ " ,
114
- \\ " single-quote\\ " : \\ " I don't know!\\ " ,
115
- emoji : \\ " 😺 \\ " ,
116
- unicode : \\ " \\\\ u0041\\ " ,
117
- \\ " unicode-escape\\ " : \\ " \\\\\\\\ u0041\\ " ,
118
- \\ " backslash-single-quote\\ " : \\ " \\\\\\\\ ' \\ " ,
119
- \\ " backslash-backslash\\ " : \\ " \\\\\\\\\\ \\\\\\\\" ,
113
+ " こんにちは" : " こんにちは!" ,
114
+ " single-quote" : " I don't know!" ,
115
+ emoji : " 😺 " ,
116
+ unicode : " \\ u0041" ,
117
+ " unicode-escape" : " \\\\ u0041" ,
118
+ " backslash-single-quote" : " \\\\ ' " ,
119
+ " backslash-backslash" : " \\\\\\\\ " ,
120
120
errors : [
121
121
' ERROR1001' , ' ERROR1002'
122
122
],
123
123
complex : {
124
124
warnings: [
125
125
' NOTE: This is warning' ,
126
126
{
127
- \\ " named-waring\\ " : ' this is {type} warining'
127
+ " named-waring" : ' this is {type} warining'
128
128
}
129
129
]
130
130
}
0 commit comments