Skip to content

Commit

Permalink
Misc bash bugfixes (#8)
Browse files Browse the repository at this point in the history
* Fix: misc bash bugfixes

* Inc version
  • Loading branch information
BolunThompson authored Jan 16, 2025
1 parent 13a43e4 commit d137302
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "shasta"
version = "0.2.1"
version = "0.2.2"
authors = [
{ name="Konstantinos Kallas", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = (Path(__file__).parent / "README.md").read_text()

setup(name='shasta',
version='0.2.1',
version='0.2.2',
packages=['shasta'],
## Necessary for the markdown to be properly rendered
long_description=long_description,
Expand Down
5 changes: 4 additions & 1 deletion shasta/ast_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,10 +1236,12 @@ class SingleArgRedirNode(RedirectionNode, BashNode):
NodeName = "SingleArg"
redir_type: str
fd: FdType # Either ('var', filename) or ('fixed', fd)
arg: None

def __init__(self, redir_type, fd):
self.redir_type = redir_type
self.fd = fd
self.arg = None

# TODO: Implement
# def __repr__(self):
Expand Down Expand Up @@ -1274,7 +1276,8 @@ def handle_redirvarassign(item: FdType, showFdUnless: int | None = None) -> str:
class GroupNode(AstNode, BashNode):
NodeName = 'Group'
body: Command
redirections: list
# TODO: Support redirections
# redirections: list

def __init__(self, body):
self.body = body
Expand Down
2 changes: 2 additions & 0 deletions shasta/bash_to_shasta_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ def to_until_node(node: WhileCom) -> WhileNode:


def to_group_node(node: GroupCom) -> GroupNode:
# TODO: Support redirections
# Libbash doesn't store the redirs currently
return GroupNode(to_ast_node(node.command))


Expand Down

0 comments on commit d137302

Please sign in to comment.