Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/struct #38

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ build-backend = "setuptools.build_meta"

[tool.poetry]
name = "mamushi"
version = "0.0.4-a0"
version = "0.0.4-a1"
description = "Vyper Formatter"
authors = ["benny <benoitb@tutanota.de>"]

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.4-a0
current_version = 0.0.4-a1
commit = False
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion src/mamushi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.4-a0"
__version__ = "0.0.4-a1"
3 changes: 2 additions & 1 deletion src/mamushi/parsing/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
EVENT_BODY = "event_body"
ENUM_BODY = "enum_body"
MODULE = "module"
BODIES = {BODY, EVENT_BODY, ENUM_BODY, MODULE}
DEF_SUFFIX = "_def"
RETURN_TYPE = "_RETURN_TYPE"
FUNCTION_SIG = "function_sig"
Expand Down Expand Up @@ -192,6 +191,8 @@
ENUM_MEMBER = "enum_member"
STRUCT_MEMBER = "struct_member"

BODIES = {BODY, EVENT_BODY, ENUM_BODY, MODULE, STRUCT_DEF}

SIMPLE_STATEMENTS = {
VARIABLE_DEF,
RETURN_STMT,
Expand Down
12 changes: 6 additions & 6 deletions tests/data/declarations/struct_decl_blank_lines.vy
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ struct MyStruct:
value2: decimal
# output
struct MyStruct:
value1: int128
value2: decimal
value1: int128
value2: decimal


struct MyStruct:
value1: int128
value2: decimal
value1: int128
value2: decimal


struct MyStruct:
value1: int128
value2: decimal
value1: int128
value2: decimal
8 changes: 4 additions & 4 deletions tests/data/declarations/struct_decl_spacing.vy
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
struct MyStruct :
value1 : int128
value2 : decimal
value1 : int128
value2 : decimal

def foo():
exampleStruct : MyStruct = MyStruct ( { value1 : 1 , value2 : 2.0 })
exampleStruct:MyStruct=MyStruct({value1:1,value2:2.0})
# output
struct MyStruct:
value1: int128
value2: decimal
value1: int128
value2: decimal


def foo():
Expand Down
Loading