Daniel Watkins
eecddd417b
Distinguish between a mutable and non-mutable borrow of vm.current_frame
...
This renames the existing (mutable) VirtualMachine.current_frame to
current_frame_mut and introduces VirtualMachine.current_frame which is
(a) public, and (b) does not take a mutable reference.
(This also switches callers to use the non-mutable version where
possible.)
2018-08-25 19:35:48 -04:00
Windel Bouwman
c41370a26f
Merge pull request #84 from OddBloke/newline
...
Don't double-count newlines in comments
2018-08-25 23:02:52 +02:00
Daniel Watkins
159a524f3f
Don't double-count newlines in comments
...
lex_comment doesn't consume the newlines, (correctly) leaving them to
the regular newline parsing. As such, it shouldn't call self.new_line,
or we end up double-counting lines.
2018-08-25 10:54:31 -04:00
cthulahoops
6aff83e2e5
Merge pull request #78 from RustPython/exceptions
...
Implement exception type checking at catch
2018-08-25 14:45:19 +01:00
Windel Bouwman
6aa9c01180
Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions
2018-08-25 10:18:51 +02:00
Windel Bouwman
882606ba1a
Move exceptions to own struct
2018-08-25 10:11:21 +02:00
Windel Bouwman
81546c6f94
Merge pull request #81 from OddBloke/newline
...
Fix a couple of newline-in-string nits
2018-08-25 08:25:38 +02:00
Windel Bouwman
33f5e7c632
Merge pull request #77 from OddBloke/import
...
Implement PYTHONPATH
2018-08-25 08:25:10 +02:00
Daniel Watkins
a06044dc6b
Reject newlines in single-quoted strings
2018-08-25 00:21:37 -04:00
Daniel Watkins
367806f845
Increment lexer row count for newlines in strings
2018-08-25 00:20:03 -04:00
Daniel Watkins
da34b86a9c
Implement PYTHONPATH
...
This modifies the import logic to use sys.path, and uses PYTHONPATH to
generate the initial contents of sys.path.
2018-08-24 22:55:30 -04:00
Windel Bouwman
f76472c00b
Add some base exceptions
2018-08-24 23:36:26 +02:00
Windel Bouwman
0f22c1a5c1
Implement exception type checking at catch
2018-08-24 22:42:20 +02:00
Windel Bouwman
42f7ecaaec
Merge pull request #76 from RustPython/bools
...
Bools
2018-08-24 21:21:02 +02:00
Adam Kelly
6d673dc56d
0 == 0.0 and 0.0 == 0
2018-08-24 18:48:34 +01:00
Adam Kelly
d60dfd2ad8
Test __bool__ and fix it.
2018-08-24 18:48:09 +01:00
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