|
@@ -1380,6 +1380,8 @@ and tcppfuncloc =
|
|
|
|
|
|
and tcpparrayloc =
|
|
and tcpparrayloc =
|
|
| ArrayTyped of tcppexpr * tcppexpr
|
|
| ArrayTyped of tcppexpr * tcppexpr
|
|
|
|
+ | ArrayPointer of tcppexpr * tcppexpr
|
|
|
|
+ | ArrayRawPointer of tcppexpr * tcppexpr
|
|
| ArrayObject of tcppexpr * tcppexpr * tcpp
|
|
| ArrayObject of tcppexpr * tcppexpr * tcpp
|
|
| ArrayVirtual of tcppexpr * tcppexpr
|
|
| ArrayVirtual of tcppexpr * tcppexpr
|
|
| ArrayImplements of tclass * tcppexpr * tcppexpr
|
|
| ArrayImplements of tclass * tcppexpr * tcppexpr
|
|
@@ -2500,6 +2502,10 @@ let retype_expression ctx request_type function_args expression_tree forInjectio
|
|
(match retypedObj.cpptype with
|
|
(match retypedObj.cpptype with
|
|
| TCppScalarArray scalar ->
|
|
| TCppScalarArray scalar ->
|
|
CppArray( ArrayTyped(retypedObj,retypedIdx) ), scalar
|
|
CppArray( ArrayTyped(retypedObj,retypedIdx) ), scalar
|
|
|
|
+ | TCppPointer (_,elem) ->
|
|
|
|
+ CppArray( ArrayPointer(retypedObj, retypedIdx) ), elem
|
|
|
|
+ | TCppRawPointer (_,elem) ->
|
|
|
|
+ CppArray( ArrayRawPointer(retypedObj, retypedIdx) ), elem
|
|
| TCppObjectArray TCppDynamic ->
|
|
| TCppObjectArray TCppDynamic ->
|
|
CppArray( ArrayObject(retypedObj,retypedIdx,TCppDynamic) ), TCppDynamic
|
|
CppArray( ArrayObject(retypedObj,retypedIdx,TCppDynamic) ), TCppDynamic
|
|
| TCppObjectArray elem ->
|
|
| TCppObjectArray elem ->
|
|
@@ -3076,6 +3082,12 @@ let gen_cpp_ast_expression_tree ctx class_name func_name function_args injection
|
|
| ArrayTyped(arrayObj,index) ->
|
|
| ArrayTyped(arrayObj,index) ->
|
|
gen arrayObj; out "->__get("; gen index; out ")"
|
|
gen arrayObj; out "->__get("; gen index; out ")"
|
|
|
|
|
|
|
|
+ | ArrayPointer(arrayObj,index) ->
|
|
|
|
+ gen arrayObj; out ".ptr["; gen index; out "]"
|
|
|
|
+
|
|
|
|
+ | ArrayRawPointer(arrayObj,index) ->
|
|
|
|
+ gen arrayObj; out "["; gen index; out "]"
|
|
|
|
+
|
|
| ArrayObject(arrayObj,index,elem) ->
|
|
| ArrayObject(arrayObj,index,elem) ->
|
|
let close = if cpp_is_dynamic_type elem then
|
|
let close = if cpp_is_dynamic_type elem then
|
|
""
|
|
""
|
|
@@ -3107,6 +3119,10 @@ let gen_cpp_ast_expression_tree ctx class_name func_name function_args injection
|
|
| ArrayObject(arrayObj, index, _)
|
|
| ArrayObject(arrayObj, index, _)
|
|
| ArrayTyped(arrayObj, index) ->
|
|
| ArrayTyped(arrayObj, index) ->
|
|
gen arrayObj; out "["; gen index; out "] = "; gen rvalue
|
|
gen arrayObj; out "["; gen index; out "] = "; gen rvalue
|
|
|
|
+ | ArrayPointer(arrayObj, index) ->
|
|
|
|
+ gen arrayObj; out ".ptr["; gen index; out "] = "; gen rvalue
|
|
|
|
+ | ArrayRawPointer(arrayObj, index) ->
|
|
|
|
+ gen arrayObj; out "["; gen index; out "] = "; gen rvalue
|
|
| ArrayVirtual(arrayObj, index) ->
|
|
| ArrayVirtual(arrayObj, index) ->
|
|
gen arrayObj; out "->set("; gen index; out ","; gen rvalue; out ")"
|
|
gen arrayObj; out "->set("; gen index; out ","; gen rvalue; out ")"
|
|
|
|
|
|
@@ -3432,6 +3448,10 @@ let gen_cpp_ast_expression_tree ctx class_name func_name function_args injection
|
|
| ArrayObject(arrayObj, index, _)
|
|
| ArrayObject(arrayObj, index, _)
|
|
| ArrayTyped(arrayObj, index) ->
|
|
| ArrayTyped(arrayObj, index) ->
|
|
gen arrayObj; out "["; gen index; out "]";
|
|
gen arrayObj; out "["; gen index; out "]";
|
|
|
|
+ | ArrayPointer(arrayObj, index) ->
|
|
|
|
+ gen arrayObj; out ".ptr["; gen index; out "]";
|
|
|
|
+ | ArrayRawPointer(arrayObj, index) ->
|
|
|
|
+ gen arrayObj; out "["; gen index; out "]";
|
|
| ArrayVirtual(arrayObj, index)
|
|
| ArrayVirtual(arrayObj, index)
|
|
| ArrayDynamic(arrayObj, index) ->
|
|
| ArrayDynamic(arrayObj, index) ->
|
|
out "hx::IndexRef("; gen arrayObj; out ".mPtr,"; gen index; out ")";
|
|
out "hx::IndexRef("; gen arrayObj; out ".mPtr,"; gen index; out ")";
|