@@ -418,7 +418,7 @@ void collectParameters(Tree tree, ref IteratePPVersions ppVersion,
418418 if (tree.content == " ..." )
419419 info.isVariadic = true ;
420420 }
421- else if (tree.nonterminalID == ParserWrapper.nonterminalIDFor ! " ParametersAndQualifiers" )
421+ else if (tree.nonterminalID.nonterminalIDAmong ! ( " ParametersAndQualifiers" , " LambdaParametersAndQualifiers " ) )
422422 {
423423 iteratePPVersions! collectParameters(tree.childs[0 ], ppVersion, semantic, info, hasDefault);
424424 iteratePPVersions! collectParameters(tree.childs[1 ], ppVersion, semantic, info, hasDefault);
@@ -505,7 +505,7 @@ void analyzeDeclarator(Tree tree, ref IteratePPVersions ppVersion,
505505 iteratePPVersions! analyzeDeclarator(tree.childs[ppVersion.combination.next(cast (uint )$)],
506506 ppVersion, semantic, info, type);
507507 }
508- else if (tree.nonterminalID == ParserWrapper.nonterminalIDFor ! " ParametersAndQualifiers" )
508+ else if (tree.nonterminalID.nonterminalIDAmong ! ( " ParametersAndQualifiers" , " LambdaParametersAndQualifiers " ) )
509509 {
510510 info.anyIsFunction = true ;
511511 info.parameterScope = semantic.currentScope.childScopeByTree[tree];
@@ -642,7 +642,7 @@ void analyzeDeclarator(Tree tree, ref IteratePPVersions ppVersion,
642642 else if (tree.nonterminalID == ParserWrapper.nonterminalIDFor! " NameIdentifier" )
643643 {
644644 assert (info.name.length == 0 , text(locationStr(tree.location), " " ,
645- info.name, " " , tree.childs[0 ].name ));
645+ info.name, " " , tree.childs[0 ].content ));
646646 assert (tree.childs.length == 1 );
647647 assert (tree.childs[0 ].nodeType == NodeType.token);
648648 if (info.inNestedNameSpecifier)
@@ -1079,7 +1079,7 @@ void analyzeSimpleDeclaration(Tree tree, immutable(Formula)* condition,
10791079 {
10801080 assert (false );
10811081 }
1082- else if (tree.name.endsWith (" FunctionBody" ))
1082+ else if (tree.nonterminalID.nonterminalIDAmong ! (" FunctionBody" , " LambdaBody " ))
10831083 {
10841084 if (ppVersion.combination.prefixDone)
10851085 return ;
@@ -1286,6 +1286,7 @@ void checkValidParam(Tree tree, ref IteratePPVersions ppVersion,
12861286 else if (tree.name.startsWith(" NoptrDeclarator" ) || tree.name.startsWith(" PtrDeclarator" )
12871287 || tree.name.startsWith(" FunctionDeclarator" )
12881288 || tree.nonterminalID == ParserWrapper.nonterminalIDFor! " ParametersAndQualifiers"
1289+ || tree.nonterminalID == ParserWrapper.nonterminalIDFor! " LambdaParametersAndQualifiers"
12891290 || tree.nonterminalID == ParserWrapper.nonterminalIDFor! " Parameters"
12901291 || tree.nonterminalID == ParserWrapper.nonterminalIDFor! " ParameterDeclaration"
12911292 || tree.nonterminalID == ParserWrapper.nonterminalIDFor! " ParameterDeclarationAbstract"
@@ -1413,7 +1414,7 @@ Tree getRealParent(Tree tree, Semantic semantic, size_t* indexInParent = null)
14131414 return realParent;
14141415}
14151416
1416- string normalizeBuiltinTypeParts (string [] parts)
1417+ string normalizeBuiltinTypeParts (string [] parts, LocationX start )
14171418{
14181419 bool isUnsigned;
14191420 bool isSigned;
@@ -1424,13 +1425,13 @@ string normalizeBuiltinTypeParts(string[] parts)
14241425 if (part == " unsigned" )
14251426 {
14261427 isUnsigned = true ;
1427- assert (! isSigned);
1428+ assert (! isSigned, locationStr(start) );
14281429 // isSigned = false;
14291430 }
14301431 else if (part == " signed" )
14311432 {
14321433 // isUnsigned = false;
1433- assert (! isUnsigned);
1434+ assert (! isUnsigned, locationStr(start) );
14341435 isSigned = true ;
14351436 }
14361437 else if (part == " short" )
@@ -1451,7 +1452,7 @@ string normalizeBuiltinTypeParts(string[] parts)
14511452 part = part[0 .. $ - 2 ];
14521453 if (baseType.length && baseType == part)
14531454 continue ;
1454- assert (baseType.length == 0 , text(parts));
1455+ assert (baseType.length == 0 , text(parts, " " , locationStr(start) ));
14551456 baseType = part;
14561457 }
14571458 }
@@ -1461,25 +1462,25 @@ string normalizeBuiltinTypeParts(string[] parts)
14611462 t ~= " unsigned_" ;
14621463 if (isSigned && baseType == " char" )
14631464 t ~= " signed_" ;
1464- assert (numShort == 0 || numLong == 0 );
1465+ assert (numShort == 0 || numLong == 0 , locationStr(start) );
14651466 foreach (k; 0 .. numShort)
14661467 t ~= " short_" ;
14671468 foreach (k; 0 .. numLong)
14681469 t ~= " long_" ;
14691470 if (baseType.length == 0 || baseType == " int" )
14701471 {
14711472 if (baseType.length == 0 )
1472- assert (numShort > 0 || numLong > 0 || isSigned || isUnsigned);
1473+ assert (numShort > 0 || numLong > 0 || isSigned || isUnsigned, locationStr(start) );
14731474 if (t.length == 0 )
14741475 t = " int" ;
14751476 else
14761477 t = t[0 .. $ - 1 ];
14771478 }
14781479 else
14791480 {
1480- assert (numShort == 0 );
1481+ assert (numShort == 0 , locationStr(start) );
14811482 assert (numLong == 0 || baseType == " double" ,
1482- text(parts));
1483+ text(parts, " " , locationStr(start) ));
14831484 t ~= baseType;
14841485 }
14851486 return t;
@@ -1495,7 +1496,7 @@ QualType getDeclSpecType(Semantic semantic, ref SimpleDeclarationInfo info)
14951496 }
14961497 else if (info.builtinTypeParts.length)
14971498 {
1498- string t = normalizeBuiltinTypeParts(info.builtinTypeParts);
1499+ string t = normalizeBuiltinTypeParts(info.builtinTypeParts, info.start );
14991500 type = QualType(semantic.getBuiltinType(t), info.qualifiers);
15001501 }
15011502 return type;
@@ -2472,7 +2473,7 @@ string fullyQualifiedName(Semantic semantic, Declaration d)
24722473 app.put(name2 ~ " ::" );
24732474 else if (s.tree.nonterminalID == nonterminalIDFor! " TemplateDeclaration" )
24742475 app.put(" template param::" );
2475- else if (s.tree.nonterminalID == nonterminalIDFor ! " ParametersAndQualifiers" )
2476+ else if (s.tree.nonterminalID.nonterminalIDAmong ! ( " ParametersAndQualifiers" , " LambdaParametersAndQualifiers " ) )
24762477 app.put(" function param::" );
24772478 }
24782479 else if (s.parentScope is null )
0 commit comments