pinline.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Generates nodes for routines that need compiler support
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit pinline;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symtype,
  22. node,
  23. globals;
  24. function new_dispose_statement(is_new:boolean) : tnode;
  25. function new_function : tnode;
  26. function inline_setlength : tnode;
  27. function inline_setstring : tnode;
  28. function inline_initialize : tnode;
  29. function inline_finalize : tnode;
  30. function inline_copy : tnode;
  31. function inline_insert : tnode;
  32. function inline_delete : tnode;
  33. function inline_concat : tnode;
  34. implementation
  35. uses
  36. { global }
  37. globtype,tokens,verbose,constexp,
  38. systems,compinnr,
  39. { symtable }
  40. symbase,symconst,symdef,symsym,symtable,defutil,
  41. { pass 1 }
  42. pass_1,htypechk,
  43. ncal,nmem,ncnv,ninl,ncon,nld,nbas,ngenutil,
  44. { parser }
  45. scanner,
  46. pbase,pexpr;
  47. function new_dispose_statement(is_new:boolean) : tnode;
  48. var
  49. newstatement : tstatementnode;
  50. temp : ttempcreatenode;
  51. para : tcallparanode;
  52. p,p2 : tnode;
  53. again : boolean; { dummy for do_proc_call }
  54. destructorname : TIDString;
  55. sym : tsym;
  56. classh : tobjectdef;
  57. callflag : tcallnodeflag;
  58. destructorpos,
  59. storepos : tfileposinfo;
  60. variantdesc : pvariantrecdesc;
  61. found : boolean;
  62. j,i : longint;
  63. variantselectsymbol : tfieldvarsym;
  64. begin
  65. if target_info.system in systems_managed_vm then
  66. message(parser_e_feature_unsupported_for_vm);
  67. consume(_LKLAMMER);
  68. p:=comp_expr([ef_accept_equal]);
  69. { calc return type }
  70. if is_new then
  71. begin
  72. set_varstate(p,vs_written,[]);
  73. valid_for_var(p,true);
  74. end
  75. else
  76. set_varstate(p,vs_readwritten,[vsf_must_be_valid]);
  77. if (m_mac in current_settings.modeswitches) and
  78. is_class(p.resultdef) then
  79. begin
  80. classh:=tobjectdef(p.resultdef);
  81. { make sure we call ObjPas.TObject.Create/Free and not a random }
  82. { create/free method in a macpas descendent object (since those }
  83. { are not supposed to be called automatically when you call }
  84. { new/dispose) }
  85. while assigned(classh.childof) do
  86. classh := classh.childof;
  87. if is_new then
  88. begin
  89. sym:=search_struct_member(classh,'CREATE');
  90. p2 := cloadvmtaddrnode.create(ctypenode.create(p.resultdef));
  91. end
  92. else
  93. begin
  94. sym:=search_struct_member(classh,'FREE');
  95. p2 := p;
  96. end;
  97. if not(assigned(sym)) then
  98. begin
  99. p.free;
  100. if is_new then
  101. p2.free;
  102. new_dispose_statement := cerrornode.create;
  103. consume_all_until(_RKLAMMER);
  104. consume(_RKLAMMER);
  105. exit;
  106. end;
  107. do_member_read(classh,false,sym,p2,again,[],nil);
  108. { we need the real called method }
  109. do_typecheckpass(p2);
  110. if (p2.nodetype=calln) and
  111. assigned(tcallnode(p2).procdefinition) then
  112. begin
  113. if is_new then
  114. begin
  115. if (tcallnode(p2).procdefinition.proctypeoption<>potype_constructor) then
  116. Message(parser_e_expr_have_to_be_constructor_call);
  117. p2.resultdef:=p.resultdef;
  118. p2:=cassignmentnode.create(p,p2);
  119. typecheckpass(p2);
  120. end
  121. else
  122. begin
  123. { Free is not a destructor
  124. if (tcallnode(p2).procdefinition.proctypeoption<>potype_destructor) then
  125. Message(parser_e_expr_have_to_be_destructor_call);
  126. }
  127. end
  128. end
  129. else
  130. internalerror(2005061202);
  131. new_dispose_statement := p2;
  132. end
  133. { constructor,destructor specified }
  134. else if (([m_mac,m_iso,m_extpas]*current_settings.modeswitches)=[]) and
  135. try_to_consume(_COMMA) then
  136. begin
  137. { extended syntax of new and dispose }
  138. { function styled new is handled in factor }
  139. { destructors have no parameters }
  140. destructorname:=pattern;
  141. destructorpos:=current_tokenpos;
  142. consume(_ID);
  143. if is_typeparam(p.resultdef) then
  144. begin
  145. p.free;
  146. p:=factor(false,[]);
  147. p.free;
  148. consume(_RKLAMMER);
  149. new_dispose_statement:=cnothingnode.create;
  150. exit;
  151. end;
  152. if (p.resultdef.typ<>pointerdef) then
  153. begin
  154. Message1(type_e_pointer_type_expected,p.resultdef.typename);
  155. p.free;
  156. p:=factor(false,[]);
  157. p.free;
  158. consume(_RKLAMMER);
  159. new_dispose_statement:=cerrornode.create;
  160. exit;
  161. end;
  162. { first parameter must be an object or class }
  163. if tpointerdef(p.resultdef).pointeddef.typ<>objectdef then
  164. begin
  165. Message(parser_e_pointer_to_class_expected);
  166. p.free;
  167. new_dispose_statement:=factor(false,[]);
  168. consume_all_until(_RKLAMMER);
  169. consume(_RKLAMMER);
  170. exit;
  171. end;
  172. { check, if the first parameter is a pointer to a _class_ }
  173. classh:=tobjectdef(tpointerdef(p.resultdef).pointeddef);
  174. if is_class(classh) then
  175. begin
  176. Message(parser_e_no_new_or_dispose_for_classes);
  177. new_dispose_statement:=factor(false,[]);
  178. consume_all_until(_RKLAMMER);
  179. consume(_RKLAMMER);
  180. exit;
  181. end;
  182. { search cons-/destructor, also in parent classes }
  183. storepos:=current_tokenpos;
  184. current_tokenpos:=destructorpos;
  185. sym:=search_struct_member(classh,destructorname);
  186. current_tokenpos:=storepos;
  187. { the second parameter of new/dispose must be a call }
  188. { to a cons-/destructor }
  189. if (not assigned(sym)) or (sym.typ<>procsym) then
  190. begin
  191. if is_new then
  192. Message(parser_e_expr_have_to_be_constructor_call)
  193. else
  194. Message(parser_e_expr_have_to_be_destructor_call);
  195. p.free;
  196. new_dispose_statement:=cerrornode.create;
  197. end
  198. else
  199. begin
  200. { For new(var,constructor) we need to take a copy because
  201. p is also used in the assignmentn below }
  202. if is_new then
  203. begin
  204. p2:=cderefnode.create(p.getcopy);
  205. include(p2.flags,nf_no_checkpointer);
  206. end
  207. else
  208. p2:=cderefnode.create(p);
  209. do_typecheckpass(p2);
  210. if is_new then
  211. callflag:=cnf_new_call
  212. else
  213. callflag:=cnf_dispose_call;
  214. if is_new then
  215. do_member_read(classh,false,sym,p2,again,[callflag],nil)
  216. else
  217. begin
  218. if not(m_fpc in current_settings.modeswitches) then
  219. do_member_read(classh,false,sym,p2,again,[callflag],nil)
  220. else
  221. begin
  222. p2:=ccallnode.create(nil,tprocsym(sym),sym.owner,p2,[callflag],nil);
  223. { support dispose(p,done()); }
  224. if try_to_consume(_LKLAMMER) then
  225. begin
  226. if not try_to_consume(_RKLAMMER) then
  227. begin
  228. Message(parser_e_no_paras_for_destructor);
  229. consume_all_until(_RKLAMMER);
  230. consume(_RKLAMMER);
  231. end;
  232. end;
  233. end;
  234. end;
  235. { we need the real called method }
  236. do_typecheckpass(p2);
  237. if (p2.nodetype=calln) and
  238. assigned(tcallnode(p2).procdefinition) then
  239. begin
  240. if is_new then
  241. begin
  242. if (tcallnode(p2).procdefinition.proctypeoption<>potype_constructor) then
  243. Message(parser_e_expr_have_to_be_constructor_call);
  244. p2.resultdef:=p.resultdef;
  245. p2:=cassignmentnode.create(p,p2);
  246. end
  247. else
  248. begin
  249. if (tcallnode(p2).procdefinition.proctypeoption<>potype_destructor) then
  250. Message(parser_e_expr_have_to_be_destructor_call);
  251. end;
  252. end
  253. else
  254. begin
  255. if is_new then
  256. CGMessage(parser_e_expr_have_to_be_constructor_call)
  257. else
  258. CGMessage(parser_e_expr_have_to_be_destructor_call);
  259. end;
  260. result:=p2;
  261. end;
  262. end
  263. else
  264. begin
  265. if (p.resultdef.typ<>pointerdef) then
  266. Begin
  267. if is_typeparam(p.resultdef) then
  268. begin
  269. p.free;
  270. consume(_RKLAMMER);
  271. new_dispose_statement:=cnothingnode.create;
  272. exit;
  273. end
  274. else
  275. begin
  276. Message1(type_e_pointer_type_expected,p.resultdef.typename);
  277. new_dispose_statement:=cerrornode.create;
  278. end;
  279. end
  280. else
  281. begin
  282. if (tpointerdef(p.resultdef).pointeddef.typ=objectdef) and
  283. (oo_has_vmt in tobjectdef(tpointerdef(p.resultdef).pointeddef).objectoptions) then
  284. Message(parser_w_use_extended_syntax_for_objects);
  285. if (tpointerdef(p.resultdef).pointeddef.typ=orddef) and
  286. (torddef(tpointerdef(p.resultdef).pointeddef).ordtype=uvoid) then
  287. begin
  288. if (m_tp7 in current_settings.modeswitches) or
  289. (m_delphi in current_settings.modeswitches) then
  290. Message(parser_w_no_new_dispose_on_void_pointers)
  291. else
  292. Message(parser_e_no_new_dispose_on_void_pointers);
  293. end;
  294. { create statements with call to getmem+initialize or
  295. finalize+freemem }
  296. new_dispose_statement:=internalstatements(newstatement);
  297. if is_new then
  298. begin
  299. { create temp for result }
  300. temp := ctempcreatenode.create(p.resultdef,p.resultdef.size,tt_persistent,true);
  301. addstatement(newstatement,temp);
  302. { create call to fpc_getmem }
  303. para := ccallparanode.create(cordconstnode.create
  304. (tpointerdef(p.resultdef).pointeddef.size,s32inttype,true),nil);
  305. addstatement(newstatement,cassignmentnode.create(
  306. ctemprefnode.create(temp),
  307. ccallnode.createintern('fpc_getmem',para)));
  308. { create call to fpc_initialize }
  309. if is_managed_type(tpointerdef(p.resultdef).pointeddef) or
  310. ((m_isolike_io in current_settings.modeswitches) and (tpointerdef(p.resultdef).pointeddef.typ=filedef)) then
  311. addstatement(newstatement,cnodeutils.initialize_data_node(cderefnode.create(ctemprefnode.create(temp)),false));
  312. { copy the temp to the destination }
  313. addstatement(newstatement,cassignmentnode.create(
  314. p,
  315. ctemprefnode.create(temp)));
  316. if (([m_iso,m_extpas]*current_settings.modeswitches)<>[]) and (is_record(tpointerdef(p.resultdef).pointeddef)) then
  317. begin
  318. variantdesc:=trecorddef(tpointerdef(p.resultdef).pointeddef).variantrecdesc;
  319. while (token=_COMMA) and assigned(variantdesc) do
  320. begin
  321. consume(_COMMA);
  322. p2:=factor(false,[]);
  323. do_typecheckpass(p2);
  324. if p2.nodetype=ordconstn then
  325. begin
  326. found:=false;
  327. { we do not have dynamic dfa, so avoid warning on variantselectsymbol below }
  328. variantselectsymbol:=nil;
  329. for i:=0 to high(variantdesc^.branches) do
  330. begin
  331. for j:=0 to high(variantdesc^.branches[i].values) do
  332. if variantdesc^.branches[i].values[j]=tordconstnode(p2).value then
  333. begin
  334. found:=true;
  335. variantselectsymbol:=tfieldvarsym(variantdesc^.variantselector);
  336. variantdesc:=variantdesc^.branches[i].nestedvariant;
  337. break;
  338. end;
  339. if found then
  340. break;
  341. end;
  342. if found then
  343. begin
  344. { if no tag-field is given, do not create an assignment statement for it }
  345. if assigned(variantselectsymbol) then
  346. { setup variant selector }
  347. addstatement(newstatement,cassignmentnode.create(
  348. csubscriptnode.create(variantselectsymbol,
  349. cderefnode.create(ctemprefnode.create(temp))),
  350. p2));
  351. end
  352. else
  353. Message(parser_e_illegal_expression);
  354. end
  355. else
  356. Message(parser_e_illegal_expression);
  357. end;
  358. end;
  359. { release temp }
  360. addstatement(newstatement,ctempdeletenode.create(temp));
  361. end
  362. else
  363. begin
  364. { create call to fpc_finalize }
  365. if is_managed_type(tpointerdef(p.resultdef).pointeddef) then
  366. addstatement(newstatement,cnodeutils.finalize_data_node(cderefnode.create(p.getcopy)));
  367. { create call to fpc_freemem }
  368. para := ccallparanode.create(p,nil);
  369. addstatement(newstatement,ccallnode.createintern('fpc_freemem',para));
  370. end;
  371. end;
  372. end;
  373. consume(_RKLAMMER);
  374. end;
  375. function new_function : tnode;
  376. var
  377. p1,p2 : tnode;
  378. classh : tobjectdef;
  379. srsym : tsym;
  380. srsymtable : TSymtable;
  381. again : boolean; { dummy for do_proc_call }
  382. begin
  383. if target_info.system in systems_managed_vm then
  384. message(parser_e_feature_unsupported_for_vm);
  385. consume(_LKLAMMER);
  386. p1:=factor(false,[]);
  387. if p1.nodetype<>typen then
  388. begin
  389. Message(type_e_type_id_expected);
  390. consume_all_until(_RKLAMMER);
  391. consume(_RKLAMMER);
  392. p1.destroy;
  393. new_function:=cerrornode.create;
  394. exit;
  395. end;
  396. if (p1.resultdef.typ<>pointerdef) then
  397. begin
  398. Message1(type_e_pointer_type_expected,p1.resultdef.typename);
  399. consume_all_until(_RKLAMMER);
  400. consume(_RKLAMMER);
  401. p1.destroy;
  402. new_function:=cerrornode.create;
  403. exit;
  404. end;
  405. if try_to_consume(_RKLAMMER) then
  406. begin
  407. if (tpointerdef(p1.resultdef).pointeddef.typ=objectdef) and
  408. (oo_has_vmt in tobjectdef(tpointerdef(p1.resultdef).pointeddef).objectoptions) then
  409. Message(parser_w_use_extended_syntax_for_objects);
  410. if p1.nodetype=typen then
  411. ttypenode(p1).allowed:=true;
  412. p1:=cinlinenode.create(in_new_x,false,p1);
  413. end
  414. else
  415. begin
  416. consume(_COMMA);
  417. if tpointerdef(p1.resultdef).pointeddef.typ<>objectdef then
  418. begin
  419. Message(parser_e_pointer_to_class_expected);
  420. consume_all_until(_RKLAMMER);
  421. consume(_RKLAMMER);
  422. p1.destroy;
  423. new_function:=cerrornode.create;
  424. exit;
  425. end;
  426. classh:=tobjectdef(tpointerdef(p1.resultdef).pointeddef);
  427. { use the objectdef for loading the VMT }
  428. p2:=p1;
  429. p1:=ctypenode.create(tpointerdef(p1.resultdef).pointeddef);
  430. do_typecheckpass(p1);
  431. { search the constructor also in the symbol tables of
  432. the parents }
  433. afterassignment:=false;
  434. searchsym_in_class(classh,classh,pattern,srsym,srsymtable,[ssf_search_helper]);
  435. consume(_ID);
  436. do_member_read(classh,false,srsym,p1,again,[cnf_new_call],nil);
  437. { we need to know which procedure is called }
  438. do_typecheckpass(p1);
  439. if not(
  440. (p1.nodetype=calln) and
  441. assigned(tcallnode(p1).procdefinition) and
  442. (tcallnode(p1).procdefinition.proctypeoption=potype_constructor)
  443. ) then
  444. Message(parser_e_expr_have_to_be_constructor_call);
  445. { constructors return boolean, update resultdef to return
  446. the pointer to the object }
  447. p1.resultdef:=p2.resultdef;
  448. p2.free;
  449. consume(_RKLAMMER);
  450. end;
  451. new_function:=p1;
  452. end;
  453. function inline_setlength : tnode;
  454. var
  455. paras: tnode;
  456. begin
  457. consume(_LKLAMMER);
  458. paras:=parse_paras(false,false,_RKLAMMER);
  459. consume(_RKLAMMER);
  460. if not assigned(paras) then
  461. begin
  462. result:=cerrornode.create;
  463. CGMessage1(parser_e_wrong_parameter_size,'SetLength');
  464. exit;
  465. end;
  466. result:=cinlinenode.create(in_setlength_x,false,paras);
  467. end;
  468. function inline_setstring : tnode;
  469. var
  470. paras, strpara, pcharpara: tnode;
  471. procname: string;
  472. cp: tstringencoding;
  473. begin
  474. consume(_LKLAMMER);
  475. paras:=parse_paras(false,false,_RKLAMMER);
  476. consume(_RKLAMMER);
  477. procname:='';
  478. if assigned(paras) and
  479. assigned(tcallparanode(paras).right) and
  480. assigned(tcallparanode(tcallparanode(paras).right).right) then
  481. begin
  482. do_typecheckpass(tcallparanode(tcallparanode(paras).right).left);
  483. do_typecheckpass(tcallparanode(tcallparanode(tcallparanode(paras).right).right).left);
  484. pcharpara:=tcallparanode(tcallparanode(paras).right).left;
  485. strpara:=tcallparanode(tcallparanode(tcallparanode(paras).right).right).left;
  486. if strpara.resultdef.typ=stringdef then
  487. begin
  488. { if there are three parameters and the first parameter
  489. ( = paras.right.right) is an ansistring, add a codepage
  490. parameter }
  491. if is_ansistring(strpara.resultdef) then
  492. begin
  493. cp:=tstringdef(strpara.resultdef).encoding;
  494. if (cp=globals.CP_NONE) then
  495. cp:=0;
  496. paras:=ccallparanode.create(genintconstnode(cp),paras);
  497. end;
  498. procname:='fpc_setstring_'+tstringdef(strpara.resultdef).stringtypname;
  499. { decide which version to call based on the second parameter }
  500. if not is_shortstring(strpara.resultdef) then
  501. if is_pwidechar(pcharpara.resultdef) or
  502. is_widechar(pcharpara.resultdef) or
  503. ((pcharpara.resultdef.typ=arraydef) and
  504. is_widechar(tarraydef(pcharpara.resultdef).elementdef)) then
  505. procname:=procname+'_pwidechar'
  506. else
  507. procname:=procname+'_pansichar';
  508. end;
  509. end;
  510. { default version (for error message) in case of missing or wrong
  511. parameters }
  512. if procname='' then
  513. if m_default_unicodestring in current_settings.modeswitches then
  514. procname:='fpc_setstring_unicodestr_pwidechar'
  515. else if m_default_ansistring in current_settings.modeswitches then
  516. procname:='fpc_setstring_ansistr_pansichar'
  517. else
  518. procname:='fpc_setstring_shortstr';
  519. result:=ccallnode.createintern(procname,paras)
  520. end;
  521. function inline_initfinal(isinit: boolean): tnode;
  522. var
  523. newblock,
  524. paras : tnode;
  525. npara,
  526. destppn,
  527. ppn : tcallparanode;
  528. begin
  529. { for easy exiting if something goes wrong }
  530. result := cerrornode.create;
  531. consume(_LKLAMMER);
  532. paras:=parse_paras(false,false,_RKLAMMER);
  533. consume(_RKLAMMER);
  534. ppn:=tcallparanode(paras);
  535. if not assigned(paras) or
  536. (assigned(ppn.right) and
  537. assigned(tcallparanode(ppn.right).right)) then
  538. begin
  539. if isinit then
  540. CGMessage1(parser_e_wrong_parameter_size,'Initialize')
  541. else
  542. CGMessage1(parser_e_wrong_parameter_size,'Finalize');
  543. exit;
  544. end;
  545. { 2 arguments? }
  546. if assigned(ppn.right) then
  547. begin
  548. destppn:=tcallparanode(ppn.right);
  549. { create call to fpc_initialize/finalize_array }
  550. npara:=ccallparanode.create(ctypeconvnode.create
  551. (ppn.left,s32inttype),
  552. ccallparanode.create(caddrnode.create_internal
  553. (crttinode.create(tstoreddef(destppn.left.resultdef),initrtti,rdt_normal)),
  554. ccallparanode.create(caddrnode.create_internal
  555. (destppn.left),nil)));
  556. if isinit then
  557. newblock:=ccallnode.createintern('fpc_initialize_array',npara)
  558. else
  559. newblock:=ccallnode.createintern('fpc_finalize_array',npara);
  560. destppn.left:=nil;
  561. end
  562. else
  563. begin
  564. if isinit then
  565. newblock:=cnodeutils.initialize_data_node(ppn.left,true)
  566. else
  567. newblock:=cnodeutils.finalize_data_node(ppn.left);
  568. end;
  569. ppn.left:=nil;
  570. paras.free;
  571. result.free;
  572. result:=newblock;
  573. end;
  574. function inline_initialize : tnode;
  575. begin
  576. result:=inline_initfinal(true);
  577. end;
  578. function inline_finalize : tnode;
  579. begin
  580. result:=inline_initfinal(false);
  581. end;
  582. function inline_copy_insert_delete(nr:tinlinenumber;name:string;checkempty:boolean) : tnode;
  583. var
  584. paras : tnode;
  585. { for easy exiting if something goes wrong }
  586. begin
  587. result := cerrornode.create;
  588. consume(_LKLAMMER);
  589. paras:=parse_paras(false,false,_RKLAMMER);
  590. consume(_RKLAMMER);
  591. if not assigned(paras) and checkempty then
  592. begin
  593. CGMessage1(parser_e_wrong_parameter_size,name);
  594. exit;
  595. end;
  596. result.free;
  597. result:=cinlinenode.create(nr,false,paras);
  598. end;
  599. function inline_copy: tnode;
  600. begin
  601. result:=inline_copy_insert_delete(in_copy_x,'Copy',false);
  602. end;
  603. function inline_insert: tnode;
  604. begin
  605. result:=inline_copy_insert_delete(in_insert_x_y_z,'Insert',false);
  606. end;
  607. function inline_delete: tnode;
  608. begin
  609. result:=inline_copy_insert_delete(in_delete_x_y_z,'Delete',false);
  610. end;
  611. function inline_concat: tnode;
  612. begin
  613. result:=inline_copy_insert_delete(in_concat_x,'Concat',false);
  614. end;
  615. end.