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

Minimum Viable Grammar #1768

Merged
merged 24 commits into from Jan 2, 2020
Merged

Minimum Viable Grammar #1768

merged 24 commits into from Jan 2, 2020

Conversation

@jacqueswww
Copy link
Collaborator

jacqueswww commented Dec 15, 2019

What I did

  • Adds lark grammar for Vyper.
  • Hooks grammar to be parsed for all get_contract_* function in testse.
  • Adds wildcard hypothesis test.

How I did it

How to verify it

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

jacqueswww added 8 commits Dec 14, 2019
Copy link
Member

fubuloubu left a comment

This is seriously cool

tests/grammar/vyper.lark Show resolved Hide resolved
vyper/ast.py Show resolved Hide resolved
tests/grammar/test_grammar.py Show resolved Hide resolved
tests/grammar/test_decorators_grammar.py Show resolved Hide resolved
tests/grammar/test_grammar.py Outdated Show resolved Hide resolved
@fubuloubu

This comment has been minimized.

Copy link
Member

fubuloubu commented Dec 15, 2019

Unsure what the py36-core failure is. Does lark work with py36?

jacqueswww added 3 commits Dec 17, 2019
jacqueswww added 2 commits Dec 18, 2019
jacqueswww added 2 commits Dec 18, 2019
@jacqueswww jacqueswww changed the title Minimum Viable Grammar (Bruteforce grammar) Minimum Viable Grammar Dec 18, 2019
setup.py Outdated Show resolved Hide resolved
Co-Authored-By: Bryant Eisenbach <3859395+fubuloubu@users.noreply.github.com>
@lgtm-com

This comment has been minimized.

Copy link

lgtm-com bot commented Dec 19, 2019

This pull request introduces 1 alert when merging 8b5984d into e0bb58d - view on LGTM.com

new alerts:

  • 1 for Implicit string concatenation in a list
jacqueswww added 3 commits Dec 19, 2019
…e_grammar
@jacqueswww jacqueswww force-pushed the jacqueswww:brute_grammar branch from c72c209 to 3e46f50 Dec 19, 2019
@jacqueswww

This comment has been minimized.

Copy link
Collaborator Author

jacqueswww commented Dec 19, 2019

@fubuloubu I have setup a separate hypthesis test case.

@jacqueswww jacqueswww force-pushed the jacqueswww:brute_grammar branch 3 times, most recently from 9fdc633 to 3e46f50 Dec 19, 2019
@fubuloubu

This comment has been minimized.

Copy link
Member

fubuloubu commented Dec 19, 2019

@jacqueswww can you call it "fuzzing" instead of "long_run_time"?

Also, the tests still take 8 mins...

@charles-cooper

This comment has been minimized.

Copy link
Collaborator

charles-cooper commented Dec 19, 2019

Seems this mainly fuzzes the grammar? Could you please update the PR description

@fubuloubu

This comment has been minimized.

Copy link
Member

fubuloubu commented Dec 19, 2019

@charles-cooper correct. @jacqueswww created a vyper grammar from the python one, using the lark tool, and is using that to create a hypothesis strategy that generates source code which should be parseable by the grammar. If anything doesn't compile, the grammar is off; if anything does compile but crashes, we have an edge case in our grammar we are not handling appropiately.

@jacqueswww

This comment has been minimized.

Copy link
Collaborator Author

jacqueswww commented Dec 20, 2019

@charles-cooper Yeah so it's a fully fledged grammar now.
It started off fuzzing; but then also went further and proved that it can parse almost all of our tests (the ones that use get_contract functions) - which to me makes it a great 'official grammar' :o)

@jacqueswww

This comment has been minimized.

Copy link
Collaborator Author

jacqueswww commented Dec 20, 2019

@fubuloubu Alright I don't know why the tests are slower; but if you check the log output - you can clearly see hypthesis doesn't run anymore - so that's something.

@jacqueswww jacqueswww force-pushed the jacqueswww:brute_grammar branch from 8ecdbf7 to 1ee5f55 Dec 20, 2019
@jacqueswww

This comment has been minimized.

Copy link
Collaborator Author

jacqueswww commented Dec 20, 2019

@fubuloubu figured it out 😸

Copy link
Collaborator

charles-cooper left a comment

This is awesome. LGTM thanks!

@fubuloubu fubuloubu merged commit cbd9ecb into vyperlang:master Jan 2, 2020
8 checks passed
8 checks passed
lint
Details
mypy
Details
py36-core
Details
py37-core
Details
py38-core
Details
fuzzing fuzzing
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
@protolambda protolambda mentioned this pull request Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.