LNode MethodOrPropertyOrVar(int startIndex, VList<LNode> attrs)
{
TokenType la0;
LNode name = default(LNode);
LNode result = default(LNode);
// line 1610
bool isExtensionMethod = false;
bool isNamedThis;
// Line 1611: (TT.This)?
la0 = LA0;
if (la0 == TT.This) {
var t = MatchAny();
// line 1611
attrs.Add(F.Id(t));
isExtensionMethod = true;
}
var type = DataType();
name = ComplexNameDecl(!isExtensionMethod, out isNamedThis);
// Line 1615: ( &{!isNamedThis} VarInitializerOpt (TT.Comma ComplexNameDecl VarInitializerOpt)* TT.Semicolon / &{!isNamedThis} MethodArgListAndBody | RestOfPropertyDefinition )
switch (LA0) {
case TT.Comma: case TT.QuickBindSet: case TT.Semicolon: case TT.Set:
{
Check(!isNamedThis, "Expected !isNamedThis");
MaybeRecognizeVarAsKeyword(ref type);
var parts = LNode.List(type);
var isArray = IsArrayType(type);
parts.Add(VarInitializerOpt(name, isArray));
// Line 1620: (TT.Comma ComplexNameDecl VarInitializerOpt)*
for (;;) {
la0 = LA0;
if (la0 == TT.Comma) {
Skip();
name = ComplexNameDecl();
parts.Add(VarInitializerOpt(name, isArray));
} else
break;
}
var end = Match((int) TT.Semicolon);
var typeStart = type.Range.StartIndex;
result = F.Call(S.Var, parts, typeStart, end.EndIndex, typeStart, typeStart);
}
break;
case TT.LParen:
{
Check(!isNamedThis, "Expected !isNamedThis");
result = MethodArgListAndBody(startIndex, type.Range.StartIndex, attrs, S.Fn, type, name);
// line 1628
return result;
}
break;
case TT.At: case TT.ContextualKeyword: case TT.Forward: case TT.LambdaArrow:
case TT.LBrace: case TT.LBrack:
result = RestOfPropertyDefinition(startIndex, type, name, false);
break;
default:
{
// line 1631
Error("Syntax error in what appears to be a method, property, or variable declaration");
ScanToEndOfStmt();
// line 1633
result = F.Call(S.Var, type, name, type.Range.StartIndex, name.Range.EndIndex);
}
break;
}
result = result.PlusAttrs(attrs);
return result;
}