Adding a location of the var/let/inout to ParamDecl

This commit is contained in:
Denis Vnukov
2016-01-25 15:45:17 -08:00
parent 8f33a03d8b
commit 4f92a08987
15 changed files with 49 additions and 41 deletions

View File

@@ -338,7 +338,8 @@ mapParsedParameters(Parser &parser,
-> ParamDecl * {
auto specifierKind = paramInfo.SpecifierKind;
bool isLet = specifierKind == Parser::ParsedParameter::Let;
auto param = new (ctx) ParamDecl(isLet, argNameLoc, argName,
auto param = new (ctx) ParamDecl(isLet, paramInfo.LetVarInOutLoc,
argNameLoc, argName,
paramNameLoc, paramName, Type(),
parser.CurDeclContext);
param->getAttrs() = paramInfo.Attrs;
@@ -834,8 +835,8 @@ Pattern *Parser::createBindingFromPattern(SourceLoc loc, Identifier name,
bool isLet) {
VarDecl *var;
if (ArgumentIsParameter) {
var = new (Context) ParamDecl(isLet, loc, name, loc, name, Type(),
CurDeclContext);
var = new (Context) ParamDecl(isLet, SourceLoc(), loc, name, loc, name,
Type(), CurDeclContext);
} else {
var = new (Context) VarDecl(/*static*/ false, /*IsLet*/ isLet,
loc, name, Type(), CurDeclContext);