128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
DiagnosticsManager::GetInstance().emitErrorMessage( v.locationId(),
"CreateConstant: the expression doesn't evaluate to a constant." );
return;
}
pEnv.lock()->storeValue(
AppendToVectorTerm( RootIdentity(), StringId( name.c_str() ) ),
ANYTERM( _ ), ValueToIRExpr( v ) );
} );
RegisterBuiltinFunc< Intrinsic< uint32_t ( string ) > >( e, "#Include"_sid,
[pEnv]( auto&& c, const Value& fnameval ) -> Value
{
auto filename = *FromValue< string >( fnameval );
|
|
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
DiagnosticsManager::GetInstance().emitErrorMessage( v.locationId(),
"CreateConstant: the expression doesn't evaluate to a constant." );
return;
}
pEnv.lock()->storeValue(
AppendToVectorTerm( RootIdentity(), StringId( name.c_str() ) ),
ANYTERM( _ ), ValueToEIR( v ) );
} );
RegisterBuiltinFunc< Intrinsic< uint32_t ( string ) > >( e, "#Include"_sid,
[pEnv]( auto&& c, const Value& fnameval ) -> Value
{
auto filename = *FromValue< string >( fnameval );
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
"#CompileFileToFunction: template parameter lists are not supported.", 0 );
return PoisonValue();
}
// TODO at some point we'll want to pass the base identity to use as a param but
// let's wait and see how the module and namespace stuff pans out first
sema::Context localC( pEnv.lock(), builtins::RootIdentity(), ValueToIRExpr( rt ) );
auto ftype = BuildFuncType( localC, rt, params );
auto funcIdentity = AppendToVectorTerm( builtins::RootIdentity(),
TERM( StringId( Env::NewUniqueId() ) ) );
c.env()->addVisibilityRule( builtins::RootIdentity(), funcIdentity );
|
|
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
"#CompileFileToFunction: template parameter lists are not supported.", 0 );
return PoisonValue();
}
// TODO at some point we'll want to pass the base identity to use as a param but
// let's wait and see how the module and namespace stuff pans out first
sema::Context localC( pEnv.lock(), builtins::RootIdentity(), ValueToEIR( rt ) );
auto ftype = BuildFuncType( localC, rt, params );
auto funcIdentity = AppendToVectorTerm( builtins::RootIdentity(),
TERM( StringId( Env::NewUniqueId() ) ) );
c.env()->addVisibilityRule( builtins::RootIdentity(), funcIdentity );
|