PageRenderTime 36ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/Backend/Modules/types.cs

https://bitbucket.org/AdamMil/boaold
C# | 62 lines | 36 code | 6 blank | 20 comment | 0 complexity | 984eeb71559ea9b2ff6e0f08912b4965 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*
  2. Boa is the reference implementation for a language similar to Python,
  3. also called Boa. This implementation is both interpreted and compiled,
  4. targeting the Microsoft .NET Framework.
  5. http://www.adammil.net/
  6. Copyright (C) 2004-2005 Adam Milazzo
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. using System;
  20. using Boa.Runtime;
  21. namespace Boa.Modules
  22. {
  23. [BoaType("module")]
  24. public sealed class types
  25. { types() { }
  26. public static string __repr__() { return "<module 'types' (built-in)>"; }
  27. public static string __str__() { return __repr__(); }
  28. public static readonly DynamicType NoneType = NullType.Value;
  29. public static readonly ReflectedType TypeType = ReflectedType.FromType(typeof(DynamicType));
  30. public static readonly ReflectedType BooleanType = ReflectedType.FromType(typeof(bool));
  31. public static readonly ReflectedType IntType = ReflectedType.FromType(typeof(int));
  32. public static readonly ReflectedType LongType = ReflectedType.FromType(typeof(long));
  33. public static readonly ReflectedType IntegerType = ReflectedType.FromType(typeof(Integer));
  34. public static readonly ReflectedType FloatType = ReflectedType.FromType(typeof(double));
  35. public static readonly ReflectedType ComplexType = ReflectedType.FromType(typeof(Complex));
  36. public static readonly ReflectedType StringType = ReflectedType.FromType(typeof(string));
  37. public static readonly ReflectedType UnicodeType = StringType;
  38. public static readonly ReflectedType TupleType = ReflectedType.FromType(typeof(Tuple));
  39. public static readonly ReflectedType ListType = ReflectedType.FromType(typeof(List));
  40. public static readonly ReflectedType DictType = ReflectedType.FromType(typeof(Dict));
  41. public static readonly ReflectedType DictionaryType = DictType;
  42. public static readonly ReflectedType FunctionType = ReflectedType.FromType(typeof(Function));
  43. public static readonly ReflectedType LambdaType = FunctionType;
  44. public static readonly ReflectedType GeneratorType = ReflectedType.FromType(typeof(Generator));
  45. public static readonly ReflectedType UserType = ReflectedType.FromType(typeof(UserType));
  46. public static readonly ReflectedType MethodType = ReflectedType.FromType(typeof(MethodWrapper));
  47. public static readonly ReflectedType UnboundMethodType = MethodType;
  48. public static readonly ReflectedType BuiltinMethodType = ReflectedType.FromType(typeof(ReflectedMethodBase));
  49. public static readonly ReflectedType FileType = ReflectedType.FromType(typeof(BoaFile));
  50. public static readonly ReflectedType XRangeType = ReflectedType.FromType(typeof(Boa.Modules.__builtin__.XRange));
  51. public static readonly ReflectedType SliceType = ReflectedType.FromType(typeof(Slice));
  52. public static readonly Tuple StringTypes = new Tuple(new object[] { StringType });
  53. }
  54. } // namespace Boa.Modules