https://github.com/microsoft/TypeScript/blob/master/doc/spec.md # Types - [ ] Primitive Types - [x] number(support signed 64): `0x10`, `12` - [x] boolean: `true`, `false` - [x] string: `"Hello"` - [x] void - [ ] null - [ ] <del>* undefined</del> - [x] enum: `enum { a = 1, b, c }` - [ ] Object - [x] Array - [ ] Tuple # Expression - [x] Assignment: `let a: number = 1;`, `let a: number[] = [1, 2, 3]` - [x] Parentheses - [x] Function Expressions - [ ] Arrow Functions - [ ] * Class Expressions - [x] Function Calls - [x] `++` / `--` - [x] `+` / `-` / `~` - [x] `!` - [ ] * `typeof` - [x] +: number + number, string + string, eg. - [x] `*`, `/`, `%,` `–`, `<<`, `>>`, `>>>`, `&`, `^`, and `|` operators - [x] `<`, `>`, `<=`, `>=`, `==`, `!=`, `===`, and `!==` operators - [ ] * `in` - [x] `&&` and `||` - [x] The Conditional Operator: `test ? expr1 : expr2` - [x] `*=`, `/=`, `%=`, `+=`, `-=`, `<<=`, `>>=`, `>>>=`, `&=`, `^=`, `|=` - [ ] <del> Destructuring Assignment: `[x, y] = [y, x];` </del> # Statements - [x] Block - [x] Variable Statements - [x] Let and Const Declarations - [x] If, Do, and While Statements - [x] For Statements - [ ] <del>For-In Statements</del> - [x] For-Of Statements - [x] Continue Statements - [x] Break Statements - [x] Return Statements - [ ] <del> With Statements </del> - [x] Switch Statements - [ ] Throw Statements - [ ] * Try Statements # Function - [x] Function Declarations - [x] Function Implementations # Interfaces # Class - [ ] Class Declarations - [ ] New class # Build in functions - [ ] See: https://www.tutorialspoint.com/javascript/javascript_builtin_functions.htm # Extra 在实现 TS 的语法过程中可以先只支持 number 类型, 如果过早考虑其他类型会遇到大量类似 string + number = ? 这类的奇怪特性.
https://github.com/microsoft/TypeScript/blob/master/doc/spec.md
Types
0x10,12true,false"Hello"* undefinedenum { a = 1, b, c }Expression
let a: number = 1;,let a: number[] = [1, 2, 3]++/--+/-/~!typeof*,/,%,–,<<,>>,>>>,&,^, and|operators<,>,<=,>=,==,!=,===, and!==operatorsin&&and||test ? expr1 : expr2*=,/=,%=,+=,-=,<<=,>>=,>>>=,&=,^=,|=Destructuring Assignment:[x, y] = [y, x];Statements
For-In StatementsWith StatementsFunction
Interfaces
Class
Build in functions
Extra
在实现 TS 的语法过程中可以先只支持 number 类型, 如果过早考虑其他类型会遇到大量类似 string + number = ? 这类的奇怪特性.