Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
82799df3
Commit
82799df3
authored
May 26, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add treatment of tuple of basic types as builtin function arguments
parent
98019ba0
No related branches found
No related tags found
1 merge request
!37
Feature/language
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/language/ast/ASTNodeBuiltinFunctionExpressionBuilder.cpp
+35
-4
35 additions, 4 deletions
src/language/ast/ASTNodeBuiltinFunctionExpressionBuilder.cpp
with
35 additions
and
4 deletions
src/language/ast/ASTNodeBuiltinFunctionExpressionBuilder.cpp
+
35
−
4
View file @
82799df3
...
...
@@ -122,14 +122,45 @@ ASTNodeBuiltinFunctionExpressionBuilder::_getArgumentConverter(const ASTNodeData
using
ParameterContentT
=
std
::
decay_t
<
decltype
(
parameter_content_v
)
>
;
switch
(
argument_node_sub_data_type
.
m_data_type
)
{
case
ASTNodeDataType
::
tuple_t
:
{
switch
(
argument_node_sub_data_type
.
m_data_type
.
contentType
())
{
const
auto
&
arg_content_type
=
argument_node_sub_data_type
.
m_data_type
.
contentType
();
switch
(
arg_content_type
)
{
case
ASTNodeDataType
::
type_id_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
EmbeddedData
>>
(
argument_number
);
}
case
ASTNodeDataType
::
bool_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
bool
>>
(
argument_number
);
}
case
ASTNodeDataType
::
unsigned_int_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
uint64_t
>>
(
argument_number
);
}
case
ASTNodeDataType
::
int_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
int64_t
>>
(
argument_number
);
}
case
ASTNodeDataType
::
double_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
double
>>
(
argument_number
);
}
case
ASTNodeDataType
::
string_t
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
std
::
string
>>
(
argument_number
);
}
case
ASTNodeDataType
::
vector_t
:
{
switch
(
arg_content_type
.
dimension
())
{
case
1
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
TinyVector
<
1
>>>
(
argument_number
);
}
case
2
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
TinyVector
<
2
>>>
(
argument_number
);
}
case
3
:
{
return
std
::
make_unique
<
FunctionTupleArgumentConverter
<
ParameterContentT
,
TinyVector
<
3
>>>
(
argument_number
);
}
default
:
{
throw
UnexpectedError
(
dataTypeName
(
arg_content_type
)
+
" unexpected content of argument, invalid dimension of vector"
);
}
}
}
default
:
{
throw
UnexpectedError
(
dataTypeName
(
argument_node_sub_data_type
.
m_data_type
.
contentType
())
+
" unexpected tuple content type of argument "
);
// return get_function_argument_converter_to_tuple_from_tuple(parameter_content_v);
throw
UnexpectedError
(
dataTypeName
(
arg_content_type
)
+
" unexpected tuple content type of argument "
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment