hyprconf2lua 1.8.0__tar.gz → 1.8.1__tar.gz
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.
- {hyprconf2lua-1.8.0/src/hyprconf2lua.egg-info → hyprconf2lua-1.8.1}/PKG-INFO +1 -1
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/pyproject.toml +1 -1
- hyprconf2lua-1.8.1/src/hyprconf2lua/__init__.py +1 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/codegen.py +15 -1
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/lexer.py +2 -2
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/parser.py +5 -5
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1/src/hyprconf2lua.egg-info}/PKG-INFO +1 -1
- hyprconf2lua-1.8.0/src/hyprconf2lua/__init__.py +0 -1
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/LICENSE +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/README.md +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/setup.cfg +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/__main__.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/ast.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/cli.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/converter.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua/mappings.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/SOURCES.txt +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/dependency_links.txt +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/entry_points.txt +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/requires.txt +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/src/hyprconf2lua.egg-info/top_level.txt +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/tests/test_converter.py +0 -0
- {hyprconf2lua-1.8.0 → hyprconf2lua-1.8.1}/tests/test_issue54.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.8.1"
|
|
@@ -55,7 +55,8 @@ class Codegen:
|
|
|
55
55
|
|
|
56
56
|
def generate(self, config: ConfigFile) -> str:
|
|
57
57
|
self.lines = []
|
|
58
|
-
|
|
58
|
+
import hyprconf2lua
|
|
59
|
+
self.emit(f"-- Generated by hyprconf2lua v{hyprconf2lua.__version__}")
|
|
59
60
|
self.emit("-- https://github.com/Prateek-squadron/hyprconf2lua")
|
|
60
61
|
self.emit("-- Manual review may be needed for complex directives")
|
|
61
62
|
self.emit("")
|
|
@@ -618,6 +619,19 @@ class Codegen:
|
|
|
618
619
|
if dispatcher == "pass":
|
|
619
620
|
return f'{func}({{ window = {self.quote(params[0]) if params else "nil"} }})'
|
|
620
621
|
|
|
622
|
+
if dispatcher == "fullscreen":
|
|
623
|
+
if params and params[0] == "1":
|
|
624
|
+
return f'{func}({{ mode = 1 }})'
|
|
625
|
+
elif params and params[0] == "0":
|
|
626
|
+
return f'{func}()'
|
|
627
|
+
return f'{func}()'
|
|
628
|
+
|
|
629
|
+
if dispatcher == "splitratio":
|
|
630
|
+
nums = params[0].split() if params else []
|
|
631
|
+
x = nums[0] if len(nums) > 0 else "0"
|
|
632
|
+
y = nums[1] if len(nums) > 1 else "0"
|
|
633
|
+
return f'{func}({{ x = {x}, y = {y}, relative = true }})'
|
|
634
|
+
|
|
621
635
|
if dispatcher == "resizeactive":
|
|
622
636
|
nums = params[0].split() if params else []
|
|
623
637
|
x = nums[0] if len(nums) > 0 else "0"
|
|
@@ -14,7 +14,7 @@ TOKEN_SPECS = [
|
|
|
14
14
|
("COLON", r":"),
|
|
15
15
|
("SHELL_EXP", r"\$\{[^}\n]*\}"),
|
|
16
16
|
("DOLLAR", r"\$"),
|
|
17
|
-
("STRING", r'"([^"\\]|\\.)*"'),
|
|
17
|
+
("STRING", r'"([^"\\]|\\.)*"|\'([^\'\\]|\\.)*\''),
|
|
18
18
|
("CONT", r"\\[ \t]*\n"),
|
|
19
19
|
("IDENT", r'[^\s#"={},:!]+'),
|
|
20
20
|
("NEWLINE", r"\n"),
|
|
@@ -71,7 +71,7 @@ def tokenize(source: str) -> List[Token]:
|
|
|
71
71
|
elif kind == "MISMATCH":
|
|
72
72
|
raise LexerError(f"Unexpected character: {value!r}", line, _col(pos))
|
|
73
73
|
elif kind == "STRING":
|
|
74
|
-
tokens.append(Token("STRING", value
|
|
74
|
+
tokens.append(Token("STRING", value, line, _col(pos)))
|
|
75
75
|
else:
|
|
76
76
|
tokens.append(Token(kind, value, line, _col(pos)))
|
|
77
77
|
|
|
@@ -15,7 +15,7 @@ BIND_FLAG_MAP = {
|
|
|
15
15
|
"bindn": "n",
|
|
16
16
|
"bindo": "",
|
|
17
17
|
"bindm": "m",
|
|
18
|
-
"binde": "",
|
|
18
|
+
"binde": "e",
|
|
19
19
|
"bindt": "t",
|
|
20
20
|
"bindi": "i",
|
|
21
21
|
"bindp": "p",
|
|
@@ -212,8 +212,8 @@ class Parser:
|
|
|
212
212
|
current.append("$" + var_t.value)
|
|
213
213
|
else:
|
|
214
214
|
t = self.advance()
|
|
215
|
-
if
|
|
216
|
-
current.append(
|
|
215
|
+
if t.type == "STRING" and not keep_string_quotes:
|
|
216
|
+
current.append(t.value[1:-1])
|
|
217
217
|
else:
|
|
218
218
|
current.append(t.value)
|
|
219
219
|
remaining = self._join_tokens(current)
|
|
@@ -445,8 +445,8 @@ class Parser:
|
|
|
445
445
|
parts.append("$" + var_t.value)
|
|
446
446
|
else:
|
|
447
447
|
t = self.advance()
|
|
448
|
-
if
|
|
449
|
-
parts.append(
|
|
448
|
+
if t.type == "STRING" and not keep_string_quotes:
|
|
449
|
+
parts.append(t.value[1:-1])
|
|
450
450
|
else:
|
|
451
451
|
parts.append(t.value)
|
|
452
452
|
return self._join_tokens(parts)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.8.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|