FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/daslib/export_constructor.das at master · alohaeee/daScript · GitHub
alohaeee
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
daslib
/
export_constructor.das
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 980 Bytes
Breadcrumbs
daScript
/
daslib
/
export_constructor.das
Copy path
File metadata and controls
25 lines (22 loc) · 980 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
options
indenting
=
4
options
no_unused_block_arguments
=
false
options
no_unused_function_arguments
=
false
options
no_aot
=
true
options
strict_smart_pointers
=
true
module
export_constructor
shared
private
require
ast
require
rtti
require
daslib
/
ast_boost
require
daslib
/
templates_boost
[
structure_macro
(
name
=
"export_constructor"
)]
class
ExportConstructor
:
AstStructureAnnotation
//! implements 'export_constructor' macro, adds function make`{StructureName} which makes a new instance of a class or structure
def
override
apply
(
var
st
:
StructurePtr
;
var
group
:
ModuleGroup
;
args
:
AnnotationArgumentList
;
var
errors
:
das_string
) :
bool
if args |> length!=0
errors := "expecting [
export_constructor
] to have no arguments"
return false
var
inscope
qfn
<
-
qmacro_function
(
"make`
{
st
.
name
}
"
)
<
|
return new <
$
t(st)>()
qfn.flags |= FunctionFlags exports
add_function(st._module, qfn)
return true
Back
|
FazBrowse Home
|
New Git URL