424 lines
15 KiB
Text
424 lines
15 KiB
Text
[
|
|
{"type":"CommentHashbang","value":"#!/usr/bin/env ucode\n"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"open"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringDouble","value":"\"fs\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"import"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"as"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"o"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"from"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringDouble","value":"\"fs\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"CommentSingle","value":"// This is a comment on a line of its own.\n"},
|
|
{"type":"KeywordDeclaration","value":"function"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"abcd"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"..."},
|
|
{"type":"NameOther","value":"values"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"print"},
|
|
{"type":"Punctuation","value":"(..."},
|
|
{"type":"NameOther","value":"values"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringDouble","value":"\"\\n\""},
|
|
{"type":"Punctuation","value":");"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"null"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"x_5"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"5"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"CommentSingle","value":"// This is a comment on a line of code.\n"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"id"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"=\u003e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"empty"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"()"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"=\u003e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"add"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"a"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"b"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"=\u003e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"a"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"+"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"b"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordConstant","value":"true"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"abcd"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":");"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordConstant","value":"false"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"abcd"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringDouble","value":"\"a\""},
|
|
{"type":"Punctuation","value":");"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"else"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"abcd"},
|
|
{"type":"Punctuation","value":"(["},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"2"},
|
|
{"type":"Punctuation","value":"]);"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"for"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"i"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"in"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"["},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"2"},
|
|
{"type":"Punctuation","value":"])"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"for"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"i"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"0"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"i"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"\u003c"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"10"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"i"},
|
|
{"type":"Operator","value":"++"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"count"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"5"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"while"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"count"},
|
|
{"type":"Operator","value":"--"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"Keyword","value":"continue"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"switch"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"case"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"6"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"8.8"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"Keyword","value":"break"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"default"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"-"},
|
|
{"type":"LiteralNumberFloat","value":"9.7"},
|
|
{"type":"NameOther","value":"e2"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"try"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n\t"},
|
|
{"type":"NameOther","value":"die"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringDouble","value":"\"\""},
|
|
{"type":"Punctuation","value":");"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"catch"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"NameOther","value":"match"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralStringDouble","value":"\"foobarbaz\""},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringRegex","value":"/b.(.)/"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"obj"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"NameOther","value":"a"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"abcd"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"b"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"-"},
|
|
{"type":"LiteralNumberInteger","value":"1"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"c"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"=\u003e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberInteger","value":"2"},
|
|
{"type":"Operator","value":"*"},
|
|
{"type":"NameOther","value":"x"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"d"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"[],"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"e"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{},"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"f"},
|
|
{"type":"Operator","value":":"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordDeclaration","value":"function"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameOther","value":"n"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Keyword","value":"return"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"this"},
|
|
{"type":"Punctuation","value":";}};"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"delete"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"obj"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"NameOther","value":"a"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"a"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"Infinity"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"b"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"NaN"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"c"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringDouble","value":"\"abc\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"d"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringSingle","value":"'abc'"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordDeclaration","value":"let"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralStringBacktick","value":"`aaa "},
|
|
{"type":"LiteralStringInterpol","value":"${"},
|
|
{"type":"NameOther","value":"id"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralNumberInteger","value":"5"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"LiteralStringInterpol","value":"}"},
|
|
{"type":"LiteralStringBacktick","value":" bbb \\u2600`"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Keyword","value":"export"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameOther","value":"id"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"}
|
|
]
|