Commit Graph

1690 Commits

Author SHA1 Message Date
Adam Kelly
d5668c32ee Add test for bools. 2018-08-24 18:23:20 +01:00
Adam Kelly
046e5e9c60 Add unary not support to parser. 2018-08-24 18:23:05 +01:00
Adam Kelly
2b6cab4e97 Add JumpIfFalse instruction to avoid negation. 2018-08-24 18:23:05 +01:00
Adam Kelly
e9b9725860 JumpIf - evaluate truthyness of argument. 2018-08-24 18:23:05 +01:00
Adam Kelly
3ff5f16a43 Integer divison leads to floats. 2018-08-24 18:23:05 +01:00
Adam Kelly
cc1641fad8 Fully support __bool__. 2018-08-24 18:23:04 +01:00
cthulahoops
3a72111c9f Merge pull request #75 from RustPython/str
Str Type
2018-08-24 17:43:53 +01:00
Adam Kelly
3c5b887d20 Add bool and float types. 2018-08-24 15:32:54 +01:00
Adam Kelly
91a11e25c2 Replace str built-in with str.__new__ 2018-08-24 15:13:06 +01:00
Adam Kelly
481186a097 Finish clean-up of type creation. 2018-08-24 15:13:06 +01:00
Daniel Watkins
db77f4d9d3 Merge pull request #74 from RustPython/dict_protocols
Complete Improvement to DictProtocol and AttributeProtocol
2018-08-24 09:23:02 -04:00
Adam Kelly
4b322fe5aa Improve rest of attribute protocol interface. 2018-08-24 10:16:45 +01:00
Adam Kelly
4278a1ecc8 Move __dict__ to object. 2018-08-24 10:16:45 +01:00
cthulahoops
97042187f6 Merge pull request #73 from RustPython/exceptions
Add BaseException class
2018-08-24 10:13:18 +01:00
Windel Bouwman
16ce7df578 Add isinstance method 2018-08-23 23:59:54 +02:00
Windel Bouwman
d4e735783e Some formatting 2018-08-23 23:11:57 +02:00
Windel Bouwman
04b786f0f3 Add try except to compiler 2018-08-22 21:42:18 +02:00
Windel Bouwman
583818378b Add BaseException class 2018-08-22 20:29:47 +02:00
Windel Bouwman
adfd6ad5bb Merge pull request #72 from RustPython/exceptions
Add row and column info to lexer
2018-08-22 19:07:52 +02:00
Windel Bouwman
f595553371 Add location vector to code object 2018-08-22 18:35:32 +02:00
Windel Bouwman
c2550ad3f1 Introduce LocatedStatement after idea from review 2018-08-22 17:49:07 +02:00
Windel Bouwman
fb69804a30 Some formatting 2018-08-22 17:01:54 +02:00
Windel Bouwman
4897e10714 Add location to statement ast type 2018-08-22 16:18:47 +02:00
Windel Bouwman
f6edf876fd Some formatting 2018-08-22 13:08:07 +02:00
Windel Bouwman
3d9b2360e3 Add row and column info to lexer 2018-08-22 12:14:37 +02:00
Daniel Watkins
a0efee1fc6 Merge pull request #69 from RustPython/floats
Add float type
2018-08-21 15:32:39 -04:00
Windel Bouwman
dd273d8278 Merge pull request #68 from RustPython/pyobject
Pyobject
2018-08-21 21:16:30 +02:00
Adam Kelly
99829d8903 Use has_attr rather than getattribute for looking up __init__ 2018-08-21 08:17:36 +01:00
Windel Bouwman
17a952dbf1 fix #34 2018-08-20 22:06:01 +02:00
Windel Bouwman
20d73d7478 Some formatting 2018-08-20 21:48:58 +02:00
Windel Bouwman
823730f023 Fix cast test snippet 2018-08-20 21:37:21 +02:00
Windel Bouwman
15e274210f Add float type 2018-08-20 21:22:14 +02:00
Adam Kelly
b3b8048cf7 Fix objtype tests. 2018-08-20 20:00:47 +01:00
Adam Kelly
8b0ba28a36 dict built-in and dict.__new__. 2018-08-20 19:54:19 +01:00
Adam Kelly
483256959a Trinity of Type, Object and Dict all mutally referential. 2018-08-20 19:54:19 +01:00
Adam Kelly
1884948bb7 Cleanup object type. 2018-08-20 19:54:19 +01:00
Adam Kelly
9f2dac74dc Create dictionary type 2018-08-20 19:54:19 +01:00
Adam Kelly
29133dd299 Rename objclass -> objobject. 2018-08-20 19:54:19 +01:00
Adam Kelly
61d7c26787 Simplify construction of list and type. 2018-08-20 19:54:19 +01:00
Windel Bouwman
aa963dcbd2 Merge pull request #67 from RustPython/mro
Compute Method Resolution Order (MRO).
2018-08-20 20:28:49 +02:00
Adam Kelly
a9c3349943 Specify bases in normal class definitions. 2018-08-19 20:55:37 +01:00
Adam Kelly
456726977e Comment out broken test snippet. 2018-08-19 20:54:45 +01:00
Adam Kelly
f89b51407f Compute linearised MRO. 2018-08-19 20:54:45 +01:00
Adam Kelly
110a7ca38c Add __class__ and __dict__ to type_type. 2018-08-19 20:54:45 +01:00
Adam Kelly
25dc93915a Add method descriptors and __mro__. 2018-08-19 20:54:45 +01:00
Adam Kelly
6bdf4148b5 Simplify new_list/new_tuple api. 2018-08-19 20:54:45 +01:00
Windel Bouwman
c664fab5b8 Merge pull request #66 from RustPython/type_new
Type new
2018-08-19 10:21:15 +02:00
Adam Kelly
ca7b792497 Get both forms of type to work properly.
Includes basic ability to traverse method resolution order (mro), but
not to derive mro or read parents from class definitions.

New and init called when creating types and instances.
__call__ works on types and instances.
Descriptors have have priority over instance variables.
2018-08-18 11:54:00 +01:00
Adam Kelly
19b4c704db set_attr for classes. 2018-08-16 07:46:04 +01:00
Adam Kelly
aa26d55b5a Add snippet for calling type. 2018-08-16 07:45:02 +01:00