bool IsLet() { if (Type != TokenType.Name || Options.EcmaVersion < 6 || (string)Value != "let") { return(false); } var skip = SkipWhiteSpace.Match(_input, _pos.Index); var next = _pos.Index + skip.Groups[0].Length; var nextCh = _input[next]; if (nextCh == 91 || nextCh == 123) { return(true); // '{' and '[' } if (IsIdentifierStart(nextCh, true)) { var pos = next + 1; while (IsIdentifierChar(_input.Get(pos), true)) { ++pos; } var ident = _input.Substring(next, pos - next); if (!KeywordRelationalOperator.IsMatch(ident)) { return(true); } } return(false); }
bool IsLet() { if (Type != TokenType.Name || !"let".Equals(Value)) { return(false); } var skip = SkipWhiteSpace.Match(_input, _pos.Index); var next = _pos.Index + skip.Groups[0].Length; var nextCh = _input[next]; if (nextCh == CharCode.LeftSquareBracket || nextCh == CharCode.LeftCurlyBracket) { return(true); // '{' and '[' } if (IsIdentifierStart(nextCh, true)) { var pos = next + 1; while (IsIdentifierChar(_input.Get(pos), true)) { ++pos; } var ident = _input.Substring(next, pos - next); if (!KeywordRelationalOperator.IsMatch(ident)) { return(true); } } return(false); }