Changeset ca9d65e for src/Concurrency/Keywords.cpp
- Timestamp:
- Dec 14, 2023, 9:05:55 PM (10 months ago)
- Branches:
- master
- Children:
- 19a2890
- Parents:
- 21ad568
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cpp
r21ad568 rca9d65e 9 9 // Author : Andrew Beach 10 10 // Created On : Tue Nov 16 9:53:00 2021 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Mar 11 10:40:00 202213 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 14 18:02:25 2023 13 // Update Count : 6 14 14 // 15 15 … … 682 682 683 683 if ( 0 != decl->returns.size() ) { 684 SemanticError( decl->location, "Generator main must return void " );684 SemanticError( decl->location, "Generator main must return void." ); 685 685 } 686 686 … … 789 789 case ast::SuspendStmt::Generator: 790 790 // Generator suspends must be directly in a generator. 791 if ( !in_generator ) SemanticError( stmt->location, " 'suspend generator'must be used inside main of generator type." );791 if ( !in_generator ) SemanticError( stmt->location, "\"suspend generator\" must be used inside main of generator type." ); 792 792 return make_generator_suspend( stmt ); 793 793 } … … 847 847 848 848 if ( !decl_suspend ) { 849 SemanticError( location, "suspend keyword applied to coroutines requires coroutines to be in scope, add #include <coroutine.hfa> \n" );849 SemanticError( location, "suspend keyword applied to coroutines requires coroutines to be in scope, add #include <coroutine.hfa>." ); 850 850 } 851 851 if ( stmt->then ) { … … 918 918 // If it is a monitor, then it is a monitor. 919 919 if( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) { 920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters \n" );920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " ); 921 921 } 922 922 } … … 926 926 // Monitors can't be constructed with mutual exclusion. 927 927 if ( CodeGen::isConstructor( decl->name ) && is_first_argument_mutex ) { 928 SemanticError( decl, "constructors cannot have mutex parameters \n" );928 SemanticError( decl, "constructors cannot have mutex parameters " ); 929 929 } 930 930 931 931 // It makes no sense to have multiple mutex parameters for the destructor. 932 932 if ( isDtor && mutexArgs.size() != 1 ) { 933 SemanticError( decl, "destructors can only have 1 mutex argument \n" );933 SemanticError( decl, "destructors can only have 1 mutex argument " ); 934 934 } 935 935 … … 945 945 // Check to if the required headers have been seen. 946 946 if ( !monitor_decl || !guard_decl || !dtor_guard_decl ) { 947 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa> \n" );947 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa>." ); 948 948 } 949 949 … … 952 952 if ( isDtor && isThread( mutexArgs.front() ) ) { 953 953 if ( !thread_guard_decl ) { 954 SemanticError( decl, "thread destructor requires threads to be in scope, add #include <thread.hfa> \n" );954 SemanticError( decl, "thread destructor requires threads to be in scope, add #include <thread.hfa>." ); 955 955 } 956 956 newBody = addThreadDtorStatements( decl, body, mutexArgs ); … … 987 987 const ast::Stmt * MutexKeyword::postvisit( const ast::MutexStmt * stmt ) { 988 988 if ( !lock_guard_decl ) { 989 SemanticError( stmt->location, "mutex stmt requires a header, add #include <mutex_stmt.hfa> \n" );989 SemanticError( stmt->location, "mutex stmt requires a header, add #include <mutex_stmt.hfa>." ); 990 990 } 991 991 ast::CompoundStmt * body = … … 1547 1547 if ( !type->base->is_thread() ) return decl; 1548 1548 if ( !thread_decl || !thread_ctor_seen ) { 1549 SemanticError( type->base->location, "thread keyword requires threads to be in scope, add #include <thread.hfa> " );1549 SemanticError( type->base->location, "thread keyword requires threads to be in scope, add #include <thread.hfa>." ); 1550 1550 } 1551 1551 const ast::CompoundStmt * stmt = decl->stmts;
Note: See TracChangeset
for help on using the changeset viewer.