@@ -377,7 +377,7 @@ namespace nzsl
377
377
}
378
378
379
379
default :
380
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
380
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " module statement " };
381
381
}
382
382
}
383
383
@@ -615,7 +615,7 @@ namespace nzsl
615
615
break ;
616
616
617
617
default :
618
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
618
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " const declaration " };
619
619
}
620
620
}
621
621
@@ -712,7 +712,7 @@ namespace nzsl
712
712
break ;
713
713
714
714
default :
715
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
715
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " external block " };
716
716
}
717
717
}
718
718
@@ -761,7 +761,7 @@ namespace nzsl
761
761
break ;
762
762
763
763
default :
764
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
764
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " external variable " };
765
765
}
766
766
}
767
767
}
@@ -824,7 +824,7 @@ namespace nzsl
824
824
break ;
825
825
826
826
default :
827
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
827
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " for loop " };
828
828
}
829
829
}
830
830
@@ -848,7 +848,7 @@ namespace nzsl
848
848
break ;
849
849
850
850
default :
851
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
851
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " foreach loop " };
852
852
}
853
853
}
854
854
@@ -952,7 +952,7 @@ namespace nzsl
952
952
}
953
953
954
954
default :
955
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
955
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " function declaration " };
956
956
}
957
957
}
958
958
@@ -1070,7 +1070,7 @@ namespace nzsl
1070
1070
{
1071
1071
case TokenType::Alias:
1072
1072
if (!attributes.empty ())
1073
- throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type };
1073
+ throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type , " alias declaration " };
1074
1074
1075
1075
return ParseAliasDeclaration ();
1076
1076
@@ -1086,9 +1086,12 @@ namespace nzsl
1086
1086
case TokenType::External:
1087
1087
return ParseExternalBlock (std::move (attributes));
1088
1088
1089
+ case TokenType::FunctionDeclaration:
1090
+ return ParseFunctionDeclaration (std::move (attributes));
1091
+
1089
1092
case TokenType::Import:
1090
1093
if (!attributes.empty ())
1091
- throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type };
1094
+ throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type , " import statement " };
1092
1095
1093
1096
return ParseImportStatement ();
1094
1097
@@ -1103,14 +1106,11 @@ namespace nzsl
1103
1106
case TokenType::Option:
1104
1107
{
1105
1108
if (!attributes.empty ())
1106
- throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type };
1109
+ throw ParserUnexpectedAttributeError{ attributes.front ().sourceLocation , attributes.front ().type , " option declaration " };
1107
1110
1108
1111
return ParseOptionDeclaration ();
1109
1112
}
1110
1113
1111
- case TokenType::FunctionDeclaration:
1112
- return ParseFunctionDeclaration (std::move (attributes));
1113
-
1114
1114
case TokenType::Struct:
1115
1115
return ParseStructDeclaration (std::move (attributes));
1116
1116
@@ -1278,7 +1278,7 @@ namespace nzsl
1278
1278
break ;
1279
1279
1280
1280
default :
1281
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
1281
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " struct declaration " };
1282
1282
}
1283
1283
}
1284
1284
@@ -1334,7 +1334,7 @@ namespace nzsl
1334
1334
break ;
1335
1335
1336
1336
default :
1337
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
1337
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " struct member " };
1338
1338
}
1339
1339
}
1340
1340
}
@@ -1406,7 +1406,7 @@ namespace nzsl
1406
1406
break ;
1407
1407
1408
1408
default :
1409
- throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type };
1409
+ throw ParserUnexpectedAttributeError{ attribute.sourceLocation , attribute.type , " while loop " };
1410
1410
}
1411
1411
}
1412
1412
0 commit comments