1
2
3
4
5
6
7
8
9
|
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "execute/execute.h"
#include "compiler.h"
using namespace goose;
namespace goose::builtins
{
|
>
|
1
2
3
4
5
6
7
8
9
10
|
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "analyze/analyze.h"
#include "execute/execute.h"
#include "compiler.h"
using namespace goose;
namespace goose::builtins
{
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
} );
RegisterBuiltinFunc< void ( bool ) >( e, "DiagnosticsForceColors"_sid,
[pEnv]( bool enable )
{
DiagnosticsManager::GetInstance().setForceColors( enable );
} );
RegisterBuiltinFunc< Intrinsic< void ( uint32_t ) > >( e, "#SetExecutionBudget"_sid,
[pEnv]( const Value& budget )
{
static bool used = false;
if( !budget.isConstant() )
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
} );
RegisterBuiltinFunc< void ( bool ) >( e, "DiagnosticsForceColors"_sid,
[pEnv]( bool enable )
{
DiagnosticsManager::GetInstance().setForceColors( enable );
} );
RegisterBuiltinFunc< Intrinsic< void ( bool ) > >( e, "#VerificationTraceMode"_sid,
[pEnv]( const Value& enable )
{
if( !enable.isConstant() )
{
DiagnosticsManager::GetInstance().emitErrorMessage( enable.locationId(),
"#VerificationTraceMode: the expression doesn't evaluate to a constant." );
return;
}
analyze::FuncValidator::SetTraceMode( *FromValue< bool >( enable ) );
} );
RegisterBuiltinFunc< Intrinsic< void ( uint32_t ) > >( e, "#SetExecutionBudget"_sid,
[pEnv]( const Value& budget )
{
static bool used = false;
if( !budget.isConstant() )
|