avrae-ls 0.4.1__py3-none-any.whl → 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {avrae_ls-0.4.1.dist-info → avrae_ls-0.5.0.dist-info}/METADATA +31 -11
- avrae_ls-0.5.0.dist-info/RECORD +6 -0
- {avrae_ls-0.4.1.dist-info → avrae_ls-0.5.0.dist-info}/WHEEL +1 -2
- avrae_ls/__init__.py +0 -3
- avrae_ls/__main__.py +0 -108
- avrae_ls/alias_preview.py +0 -346
- avrae_ls/api.py +0 -2014
- avrae_ls/argparser.py +0 -430
- avrae_ls/argument_parsing.py +0 -67
- avrae_ls/code_actions.py +0 -282
- avrae_ls/codes.py +0 -3
- avrae_ls/completions.py +0 -1391
- avrae_ls/config.py +0 -496
- avrae_ls/context.py +0 -229
- avrae_ls/cvars.py +0 -115
- avrae_ls/diagnostics.py +0 -751
- avrae_ls/dice.py +0 -33
- avrae_ls/parser.py +0 -44
- avrae_ls/runtime.py +0 -661
- avrae_ls/server.py +0 -399
- avrae_ls/signature_help.py +0 -252
- avrae_ls/symbols.py +0 -266
- avrae_ls-0.4.1.dist-info/RECORD +0 -34
- avrae_ls-0.4.1.dist-info/top_level.txt +0 -2
- draconic/__init__.py +0 -4
- draconic/exceptions.py +0 -157
- draconic/helpers.py +0 -236
- draconic/interpreter.py +0 -1091
- draconic/string.py +0 -100
- draconic/types.py +0 -364
- draconic/utils.py +0 -78
- draconic/versions.py +0 -4
- {avrae_ls-0.4.1.dist-info → avrae_ls-0.5.0.dist-info}/entry_points.txt +0 -0
- {avrae_ls-0.4.1.dist-info → avrae_ls-0.5.0.dist-info}/licenses/LICENSE +0 -0
avrae_ls/dice.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import d20
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class RerollableStringifier(d20.SimpleStringifier):
|
|
7
|
-
"""Stringifier that emits rerollable expressions and skips dropped dice."""
|
|
8
|
-
|
|
9
|
-
def _stringify(self, node):
|
|
10
|
-
if not node.kept:
|
|
11
|
-
return None
|
|
12
|
-
return super()._stringify(node)
|
|
13
|
-
|
|
14
|
-
def _str_expression(self, node):
|
|
15
|
-
return self._stringify(node.roll)
|
|
16
|
-
|
|
17
|
-
def _str_literal(self, node):
|
|
18
|
-
return str(node.total)
|
|
19
|
-
|
|
20
|
-
def _str_parenthetical(self, node):
|
|
21
|
-
return f"({self._stringify(node.value)})"
|
|
22
|
-
|
|
23
|
-
def _str_set(self, node):
|
|
24
|
-
out = f"{', '.join([self._stringify(v) for v in node.values if v.kept])}"
|
|
25
|
-
if len(node.values) == 1:
|
|
26
|
-
return f"({out},)"
|
|
27
|
-
return f"({out})"
|
|
28
|
-
|
|
29
|
-
def _str_dice(self, node):
|
|
30
|
-
return self._str_set(node)
|
|
31
|
-
|
|
32
|
-
def _str_die(self, node):
|
|
33
|
-
return str(node.total)
|
avrae_ls/parser.py
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import re
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@dataclass
|
|
9
|
-
class DraconicBlock:
|
|
10
|
-
code: str
|
|
11
|
-
line_offset: int
|
|
12
|
-
char_offset: int = 0
|
|
13
|
-
line_count: int = 0
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
DRACONIC_RE = re.compile(r"<drac2>([\s\S]*?)</drac2>", re.IGNORECASE)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def find_draconic_blocks(source: str) -> List[DraconicBlock]:
|
|
20
|
-
blocks: list[DraconicBlock] = []
|
|
21
|
-
for match in DRACONIC_RE.finditer(source):
|
|
22
|
-
raw = match.group(1)
|
|
23
|
-
prefix = source[: match.start()]
|
|
24
|
-
line_offset = prefix.count("\n")
|
|
25
|
-
# Column where draconic content starts on its first line
|
|
26
|
-
last_nl = prefix.rfind("\n")
|
|
27
|
-
start_col = match.start(1) - (last_nl + 1 if last_nl != -1 else 0)
|
|
28
|
-
char_offset = start_col
|
|
29
|
-
# Trim leading blank lines inside the block while tracking the line shift
|
|
30
|
-
while raw.startswith("\n"):
|
|
31
|
-
raw = raw[1:]
|
|
32
|
-
line_offset += 1
|
|
33
|
-
char_offset = 0
|
|
34
|
-
line_count = raw.count("\n") + 1 if raw else 1
|
|
35
|
-
blocks.append(DraconicBlock(code=raw, line_offset=line_offset, char_offset=char_offset, line_count=line_count))
|
|
36
|
-
return blocks
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def primary_block_or_source(source: str) -> tuple[str, int, int]:
|
|
40
|
-
blocks = find_draconic_blocks(source)
|
|
41
|
-
if not blocks:
|
|
42
|
-
return source, 0, 0
|
|
43
|
-
block = blocks[0]
|
|
44
|
-
return block.code, block.line_offset, block.char_offset
|