mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 19:43:43 +00:00
Update syntax test
This commit is contained in:
parent
bb4d4d7eb9
commit
d0e0c336d0
@ -398,7 +398,129 @@ mod test {
|
||||
#[test] fn string_to_tts_1 () {
|
||||
let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");
|
||||
assert_eq!(to_json_str(@tts),
|
||||
~"[{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"fn\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"a\",false]}]},{\"variant\":\"tt_delim\",\"fields\":[[{\"variant\":\"tt_tok\",\"fields\":[null,\"LPAREN\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"b\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"COLON\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"int\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"RPAREN\"]}]]},{\"variant\":\"tt_delim\",\"fields\":[[{\"variant\":\"tt_tok\",\"fields\":[null,\"LBRACE\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"b\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"SEMI\"]},{\"variant\":\"tt_tok\",\"fields\":[null,\"RBRACE\"]}]]}]"
|
||||
~"[\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
{\
|
||||
\"variant\":\"IDENT\",\
|
||||
\"fields\":[\
|
||||
\"fn\",\
|
||||
false\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
{\
|
||||
\"variant\":\"IDENT\",\
|
||||
\"fields\":[\
|
||||
\"a\",\
|
||||
false\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_delim\",\
|
||||
\"fields\":[\
|
||||
[\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"LPAREN\"\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
{\
|
||||
\"variant\":\"IDENT\",\
|
||||
\"fields\":[\
|
||||
\"b\",\
|
||||
false\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"COLON\"\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
{\
|
||||
\"variant\":\"IDENT\",\
|
||||
\"fields\":[\
|
||||
\"int\",\
|
||||
false\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"RPAREN\"\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_delim\",\
|
||||
\"fields\":[\
|
||||
[\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"LBRACE\"\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
{\
|
||||
\"variant\":\"IDENT\",\
|
||||
\"fields\":[\
|
||||
\"b\",\
|
||||
false\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"SEMI\"\
|
||||
]\
|
||||
},\
|
||||
{\
|
||||
\"variant\":\"tt_tok\",\
|
||||
\"fields\":[\
|
||||
null,\
|
||||
\"RBRACE\"\
|
||||
]\
|
||||
}\
|
||||
]\
|
||||
]\
|
||||
}\
|
||||
]"
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user