Skip to content

Commit

Permalink
+ Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Genarito committed Apr 28, 2021
1 parent 8494c4c commit 73baeb8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ hosts: [
]
"""

parsed_gura = gura.loads(gura_string)

# Loads: transforms a Gura string into a dictionary
parsed_gura = gura.loads(gura_string)
print(parsed_gura) # {'title': 'Gura Example', 'an_object': {'username': 'Stephen', 'pass': 'Hawking'}, 'hosts': ['alpha', 'omega']}

# Iterate over structure
# Access a specific field
print(f"Title -> {parsed_gura['title']}")

# Iterate over structure
for host in parsed_gura['hosts']:
print(f'Host -> {host}')

Expand All @@ -46,13 +46,11 @@ print(gura.dumps(parsed_gura))

## Contributing

All kind of contribution is welcome! **This is the first parser I've ever done.** So there are probably a lot of things that could be done in a better way.

There are some TODOs in mind to complete:
All kind of contribution is welcome! If you want to contribute just:

- [ ] Add line and position in semantics errors (like InvalidIndentationError) messages.
- [ ] Replace `getattr` in `match()` method for a tuple of Callable objects to make the code more typed.
- [ ] Add some more tests.
1. Fork this repository.
1. Create a new branch and introduce there your new changes.
1. Make a Pull Request!


### Tests
Expand Down

0 comments on commit 73baeb8

Please sign in to comment.