Syntax.hx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. package python;
  23. import haxe.extern.Rest;
  24. @:noPackageRestrict
  25. @:noClosure
  26. extern class Syntax {
  27. @:noUsing macro public static function importModule(module:String):haxe.macro.Expr;
  28. @:noUsing macro public static function importAs(module:String, className:String):haxe.macro.Expr;
  29. @:overload(function(className:String, args:Rest<Dynamic>):Dynamic {})
  30. static function construct<T>(cls:Class<T>, args:Rest<Dynamic>):T;
  31. @:noUsing
  32. @:deprecated("python.Syntax.newInstance() is deprecated. Use python.Syntax.construct() instead.")
  33. macro public static function newInstance(c:haxe.macro.Expr, params:Array<haxe.macro.Expr>):haxe.macro.Expr;
  34. extern static function _newInstance(c:Dynamic, args:Array<Dynamic>):Dynamic;
  35. @:noUsing
  36. extern static function isIn(a:Dynamic, b:Dynamic):Bool;
  37. @:noUsing
  38. extern static function delete(a:Dynamic):Void;
  39. @:noUsing
  40. extern static function binop(a:Dynamic, op:String, b:Dynamic):Dynamic;
  41. @:noUsing
  42. extern static function assign(a:Dynamic, b:Dynamic):Void;
  43. static function code(code:String, args:Rest<Dynamic>):Dynamic;
  44. @:noUsing
  45. @:deprecated("python.Syntax.pythonCode() is deprecated. Use python.Syntax.code() instead.")
  46. macro public static function pythonCode(b:ExprOf<String>, rest:Array<haxe.macro.Expr>):haxe.macro.Expr;
  47. @:noUsing
  48. static function _pythonCode<T>(b:String, args:Array<Dynamic>):T;
  49. @:noUsing
  50. macro public static function arrayAccess(x:haxe.macro.Expr, rest:Array<haxe.macro.Expr>):haxe.macro.Expr.ExprOf<Dynamic>;
  51. @:noUsing
  52. macro public static function arrayAccessWithTrailingColon(x:haxe.macro.Expr, rest:Array<haxe.macro.Expr>):haxe.macro.Expr.ExprOf<Dynamic>;
  53. extern static function _arrayAccess(a:Dynamic, args:Array<Dynamic>, ?trailingColon:Bool = false):Dynamic;
  54. @:noUsing
  55. extern static function arraySet(a:Dynamic, i:Dynamic, v:Dynamic):Dynamic;
  56. extern static function _foreach(id:Dynamic, it:Dynamic, block:Dynamic):Dynamic;
  57. @:noUsing
  58. macro public static function foreach<T>(v:haxe.macro.Expr, it:haxe.macro.Expr, b:haxe.macro.Expr):haxe.macro.Expr;
  59. @:noUsing macro public static function importFromAs(from:String, module:String, className:String):haxe.macro.Expr;
  60. @:noUsing
  61. macro public static function callField(o:haxe.macro.Expr, field:haxe.macro.Expr.ExprOf<String>, params:Array<haxe.macro.Expr>):haxe.macro.Expr;
  62. extern static function call(e:Dynamic, args:Array<Dynamic>):Dynamic;
  63. @:noUsing
  64. extern static function field(o:Dynamic, field:String):Dynamic;
  65. @:noUsing
  66. macro public static function tuple(args:Array<haxe.macro.Expr>):haxe.macro.Expr;
  67. extern static function _tuple(args:Array<Dynamic>):Dynamic;
  68. @:noUsing
  69. extern static function varArgs(args:Array<Dynamic>):Dynamic;
  70. macro public static function callNamedUntyped(e:haxe.macro.Expr, args:haxe.macro.Expr):haxe.macro.Expr;
  71. extern static function _callNamedUntyped(e:Dynamic, args:Dynamic):Dynamic;
  72. extern static function opPow(a:Int, b:Int):Int;
  73. }