Commit Graph

  • f76472c00b Add some base exceptions Windel Bouwman 2018-08-24 23:36:26 +02:00
  • 0f22c1a5c1 Implement exception type checking at catch Windel Bouwman 2018-08-24 22:42:20 +02:00
  • 42f7ecaaec Merge pull request #76 from RustPython/bools Windel Bouwman 2018-08-24 21:21:02 +02:00
  • 6d673dc56d 0 == 0.0 and 0.0 == 0 Adam Kelly 2018-08-24 18:48:34 +01:00
  • d60dfd2ad8 Test __bool__ and fix it. Adam Kelly 2018-08-24 18:48:09 +01:00
  • d5668c32ee Add test for bools. Adam Kelly 2018-08-24 18:23:20 +01:00
  • 046e5e9c60 Add unary not support to parser. Adam Kelly 2018-08-24 18:22:24 +01:00
  • 2b6cab4e97 Add JumpIfFalse instruction to avoid negation. Adam Kelly 2018-08-24 17:55:14 +01:00
  • e9b9725860 JumpIf - evaluate truthyness of argument. Adam Kelly 2018-08-24 17:39:33 +01:00
  • 3ff5f16a43 Integer divison leads to floats. Adam Kelly 2018-08-24 17:34:47 +01:00
  • cc1641fad8 Fully support __bool__. Adam Kelly 2018-08-24 17:33:20 +01:00
  • 3a72111c9f Merge pull request #75 from RustPython/str cthulahoops 2018-08-24 17:43:53 +01:00
  • 3c5b887d20 Add bool and float types. Adam Kelly 2018-08-24 15:32:54 +01:00
  • 91a11e25c2 Replace str built-in with str.__new__ Adam Kelly 2018-08-24 11:46:47 +01:00
  • 481186a097 Finish clean-up of type creation. Adam Kelly 2018-08-24 11:30:53 +01:00
  • db77f4d9d3 Merge pull request #74 from RustPython/dict_protocols Daniel Watkins 2018-08-24 09:23:02 -04:00
  • 4b322fe5aa Improve rest of attribute protocol interface. Adam Kelly 2018-08-21 20:03:46 +01:00
  • 4278a1ecc8 Move __dict__ to object. Adam Kelly 2018-08-21 08:25:39 +01:00
  • 97042187f6 Merge pull request #73 from RustPython/exceptions cthulahoops 2018-08-24 10:13:18 +01:00
  • 16ce7df578 Add isinstance method Windel Bouwman 2018-08-23 23:59:54 +02:00
  • d4e735783e Some formatting Windel Bouwman 2018-08-23 23:11:57 +02:00
  • 04b786f0f3 Add try except to compiler Windel Bouwman 2018-08-22 21:42:18 +02:00
  • 583818378b Add BaseException class Windel Bouwman 2018-08-22 20:29:47 +02:00
  • adfd6ad5bb Merge pull request #72 from RustPython/exceptions Windel Bouwman 2018-08-22 19:07:52 +02:00
  • f595553371 Add location vector to code object Windel Bouwman 2018-08-22 18:35:32 +02:00
  • c2550ad3f1 Introduce LocatedStatement after idea from review Windel Bouwman 2018-08-22 17:49:07 +02:00
  • fb69804a30 Some formatting Windel Bouwman 2018-08-22 17:01:54 +02:00
  • 4897e10714 Add location to statement ast type Windel Bouwman 2018-08-22 16:18:47 +02:00
  • f6edf876fd Some formatting Windel Bouwman 2018-08-22 13:08:07 +02:00
  • 3d9b2360e3 Add row and column info to lexer Windel Bouwman 2018-08-22 12:14:37 +02:00
  • a0efee1fc6 Merge pull request #69 from RustPython/floats Daniel Watkins 2018-08-21 15:32:39 -04:00
  • dd273d8278 Merge pull request #68 from RustPython/pyobject Windel Bouwman 2018-08-21 21:16:30 +02:00
  • 99829d8903 Use has_attr rather than getattribute for looking up __init__ Adam Kelly 2018-08-21 08:17:36 +01:00
  • 17a952dbf1 fix #34 Windel Bouwman 2018-08-20 22:06:01 +02:00
  • 20d73d7478 Some formatting Windel Bouwman 2018-08-20 21:48:58 +02:00
  • 823730f023 Fix cast test snippet Windel Bouwman 2018-08-20 21:37:21 +02:00
  • 15e274210f Add float type Windel Bouwman 2018-08-20 21:22:14 +02:00
  • b3b8048cf7 Fix objtype tests. Adam Kelly 2018-08-20 20:00:47 +01:00
  • 8b0ba28a36 dict built-in and dict.__new__. Adam Kelly 2018-08-20 19:04:02 +01:00
  • 483256959a Trinity of Type, Object and Dict all mutally referential. Adam Kelly 2018-08-20 07:59:15 +01:00
  • 1884948bb7 Cleanup object type. Adam Kelly 2018-08-20 07:27:48 +01:00
  • 9f2dac74dc Create dictionary type Adam Kelly 2018-08-20 07:26:09 +01:00
  • 29133dd299 Rename objclass -> objobject. Adam Kelly 2018-08-20 06:59:25 +01:00
  • 61d7c26787 Simplify construction of list and type. Adam Kelly 2018-08-20 06:55:27 +01:00
  • aa963dcbd2 Merge pull request #67 from RustPython/mro Windel Bouwman 2018-08-20 20:28:49 +02:00
  • a9c3349943 Specify bases in normal class definitions. Adam Kelly 2018-08-19 14:39:02 +01:00
  • 456726977e Comment out broken test snippet. Adam Kelly 2018-08-19 10:27:53 +01:00
  • f89b51407f Compute linearised MRO. Adam Kelly 2018-08-19 10:23:04 +01:00
  • 110a7ca38c Add __class__ and __dict__ to type_type. Adam Kelly 2018-08-18 18:28:12 +01:00
  • 25dc93915a Add method descriptors and __mro__. Adam Kelly 2018-08-18 18:21:41 +01:00
  • 6bdf4148b5 Simplify new_list/new_tuple api. Adam Kelly 2018-08-18 18:19:50 +01:00
  • c664fab5b8 Merge pull request #66 from RustPython/type_new Windel Bouwman 2018-08-19 10:21:15 +02:00
  • ca7b792497 Get both forms of type to work properly. Adam Kelly 2018-08-18 11:53:56 +01:00
  • 19b4c704db set_attr for classes. Adam Kelly 2018-08-16 07:46:04 +01:00
  • aa26d55b5a Add snippet for calling type. Adam Kelly 2018-08-16 07:45:02 +01:00
  • 79ec7990a8 builtin_build_class should call objtype::new Adam Kelly 2018-08-15 17:30:42 +01:00
  • d8a8e86c22 Merge pull request #65 from RustPython/object Windel Bouwman 2018-08-15 21:31:42 +02:00
  • fd116b7d3f Add object class. Adam Kelly 2018-08-15 17:03:29 +01:00
  • 66c5f0f96a Merge pull request #63 from RustPython/list_append cthulahoops 2018-08-15 16:59:18 +01:00
  • 942d74e9a7 Merge pull request #64 from RustPython/callable_2 Windel Bouwman 2018-08-15 17:04:56 +02:00
  • a7ff8a01bc Rust formatting Windel Bouwman 2018-08-15 14:29:01 +02:00
  • 68554d8dd2 Refactor to simplify body of invoke. Adam Kelly 2018-08-15 12:42:08 +01:00
  • 9917bebb99 Remove unnecessary mutability in DictProtocol. Adam Kelly 2018-08-15 12:40:52 +01:00
  • 8eee2cec74 Add (broken) callable test. Adam Kelly 2018-08-15 08:34:27 +01:00
  • f488843970 Implement __call__ Adam Kelly 2018-08-15 08:34:03 +01:00
  • eb9d61fbdb Remove unneeded mutable borrow which causes trace crash. Adam Kelly 2018-08-15 08:32:58 +01:00
  • 6854aacf5e Add builtin chr function Windel Bouwman 2018-08-15 13:52:08 +02:00
  • 19300496c2 Let len method invoke list __len__ function Windel Bouwman 2018-08-15 13:32:39 +02:00
  • a388334c9e Call vm.get_attribute from getattr Windel Bouwman 2018-08-15 10:00:47 +02:00
  • c81e497ace Add setattr built-in Windel Bouwman 2018-08-15 00:02:15 +02:00
  • 6444b50a44 Add getattr and hasattr builtins Windel Bouwman 2018-08-14 23:39:47 +02:00
  • 2069a4fa82 Merge pull request #62 from RustPython/list_append cthulahoops 2018-08-14 22:16:11 +01:00
  • c9816c37de Fix append snippet Windel Bouwman 2018-08-14 22:44:55 +02:00
  • 919b7f631d Add reverse function to list Windel Bouwman 2018-08-14 22:01:40 +02:00
  • 34bba7a257 Borrow list object mutably and append item Windel Bouwman 2018-08-14 21:52:00 +02:00
  • 4ada085234 Format code properly and try to implement append function Windel Bouwman 2018-08-14 21:21:47 +02:00
  • 51acd6c4b5 Register append function to list type Windel Bouwman 2018-08-14 20:56:14 +02:00
  • 573edffafc Merge pull request #60 from RustPython/none Daniel Watkins 2018-08-12 17:12:52 -04:00
  • c83f548d92 There is only one none. Adam Kelly 2018-08-12 20:16:58 +01:00
  • 1ad9f87f4e Merge pull request #59 from RustPython/methods cthulahoops 2018-08-12 19:34:39 +01:00
  • 3a6649ddeb Use standard method machinary to call __init__. Adam Kelly 2018-08-12 18:26:04 +01:00
  • 4b52f72316 load_attr to use class based attribute getting. Adam Kelly 2018-08-12 09:48:32 +01:00
  • 0597cff6c6 Add has_attr to AttributeProtocol. Adam Kelly 2018-08-12 09:47:21 +01:00
  • 6889b34515 Add Type Protocol. Adam Kelly 2018-08-12 09:46:48 +01:00
  • 43011d3a9c Create functions with type of function class. Adam Kelly 2018-08-12 09:45:04 +01:00
  • cb3bd23cb1 Add modules for class and function objects. Adam Kelly 2018-08-12 09:43:35 +01:00
  • 9776385ce9 Ignore vim swap files. Adam Kelly 2018-08-12 18:26:41 +01:00
  • 1f8595cc94 Merge pull request #58 from OddBloke/trailing_commas Windel Bouwman 2018-08-12 12:20:00 +02:00
  • 19c9db2375 Parse trailing commas in lists/dicts Daniel Watkins 2018-08-11 23:37:01 -04:00
  • 37c1377fcb Merge pull request #57 from OddBloke/rustfmt Windel Bouwman 2018-08-11 10:09:45 +02:00
  • aa41eb7cd1 Add rustfmt check to Travis Daniel Watkins 2018-08-10 20:15:49 -04:00
  • 2a90df80c8 Run cargo fmt to format the entire project Daniel Watkins 2018-08-10 20:12:32 -04:00
  • a9653931b7 Fix warnings emitted during cargo test Daniel Watkins 2018-08-10 17:13:27 -04:00
  • 76a19d35be Move lexer::lex_source in to tests module Daniel Watkins 2018-08-10 17:10:42 -04:00
  • 8bda921856 Merge pull request #56 from OddBloke/warnings cthulahoops 2018-08-10 22:02:32 +01:00
  • 0b5248827b Allow TryExcept to be dead code (for now) Daniel Watkins 2018-08-10 16:27:09 -04:00
  • ede4533349 Rename objdict::_set_item as it is unused Daniel Watkins 2018-08-10 16:13:14 -04:00
  • f879fd9b43 Rename objlist::append as it is unused Daniel Watkins 2018-08-10 16:12:39 -04:00
  • a15007f10d Remove the unused and empy objint::add function Daniel Watkins 2018-08-10 16:11:58 -04:00
  • 340d90a3f9 Refactor push_code_object to push_new_code_object Daniel Watkins 2018-08-10 15:56:28 -04:00