MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / ast_structureAlias

Function ast_structureAlias

src/parser/parser_impl.cpp:277–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 }
276
277 bool ast_structureAlias ( yyscan_t scanner, string * name, TypeDecl * typeDecl, const LineInfo & atName ) {
278 if (!typeDecl->alias.empty()) {
279 das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName,
280 CompilationError::already_declared_type_alias);
281 delete name;
282 delete typeDecl;
283 return false;
284 }
285 typeDecl->alias = *name;
286 delete name;
287 if ( !yyextra->g_thisStructure ) {
288 das_yyerror(scanner,"typedef outside of structure", atName,
289 CompilationError::invalid_type_alias);
290 delete typeDecl;
291 return false;
292 }
293 if ( yyextra->g_thisStructure->aliases.find(typeDecl->alias) ) {
294 das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName,
295 CompilationError::already_declared_type_alias);
296 delete typeDecl;
297 return false;
298 }
299 yyextra->g_thisStructure->aliases.insert(typeDecl->alias, typeDecl);
300 return true;
301 }
302
303 void ast_structureDeclaration ( yyscan_t scanner, AnnotationList * annL, const LineInfo & loc, Structure * ps,
304 const LineInfo & atPs, vector<VariableDeclaration*> * list ) {

Callers 3

yyparseFunction · 0.85
yyparseFunction · 0.85
yyparseFunction · 0.85

Calls 4

das_yyerrorFunction · 0.70
emptyMethod · 0.45
findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected