Skip to content

Commit ac74bf6

Browse files
authored
Merge pull request #47 from samarium-lang/fix-nyaa
2 parents 6f2b822 + 8ec8609 commit ac74bf6

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.1] - 2023-04-08
9+
10+
### Added
11+
- `~` is now equal to `-1` when not followed by a value (e.g. `~;` or `~<`, but
12+
not `~x` or `~/\`)
13+
14+
### Fixed
15+
- Implicit null is no longer placed before `~` (meaning that `>~<` is no longer
16+
invalid syntax)
17+
818
## [0.5.0] - 2023-04-02
919

1020
### Added
@@ -378,4 +388,5 @@ Initial release 🚀
378388
[0.3.0]: https://github.com/samarium-lang/Samarium/compare/0.2.3...0.3.0
379389
[0.3.1]: https://github.com/samarium-lang/Samarium/compare/0.3.0...0.3.1
380390
[0.4.0]: https://github.com/samarium-lang/Samarium/compare/0.3.1...0.4.0
381-
[0.5.0]: https://github.com/samarium-lang/Samarium/compare/0.4.0...0.5.0
391+
[0.5.0]: https://github.com/samarium-lang/Samarium/compare/0.4.0...0.5.0
392+
[0.5.1]: https://github.com/samarium-lang/Samarium/compare/0.5.0...0.5.1

docs/tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ you'll launch the REPL, an interactive shell that will read
2020
and evaluate any Samarium code you enter.
2121
```txt
2222
$ samarium
23-
Samarium 0.5.0
23+
Samarium 0.5.1
2424
-->
2525
```
2626
Interacting with the REPL is a nice way to experiment with Samarium:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "samarium"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
description = "The Samarium Programming Language"
55
authors = ["trag1c <[email protected]>"]
66
license = "MIT"

src/samarium/classes/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ def __hash__(self) -> int:
831831
def hash(self) -> Number:
832832
return Num(hash(self.val))
833833

834+
def __invert__(self) -> Number:
835+
return Num(-1)
836+
834837
def __floordiv__(self, other: Any) -> Number:
835838
return Num(not other)
836839

src/samarium/transpiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ def _operators(self, token: Token, push: Callable) -> None:
455455
if token is Token.IN and self._prev is Token.NOT:
456456
pass
457457
elif (
458-
token in Group.operators - {Token.NOT, Token.IN, Token.SUB, Token.ADD}
458+
token
459+
in Group.operators - {Token.BNOT, Token.NOT, Token.IN, Token.SUB, Token.ADD}
459460
and self._prev in Group.operators
460461
or (
461462
self._prev

src/samarium/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .exceptions import SamariumTypeError, SamariumValueError
88

9-
__version__ = "0.5.0"
9+
__version__ = "0.5.1"
1010

1111
T = TypeVar("T")
1212

0 commit comments

Comments
 (0)