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

Currently unparseable parts of Pollen programs #135

Open
8 tasks
priyasrikumar opened this issue Aug 1, 2023 · 3 comments
Open
8 tasks

Currently unparseable parts of Pollen programs #135

priyasrikumar opened this issue Aug 1, 2023 · 3 comments

Comments

@priyasrikumar
Copy link
Contributor

priyasrikumar commented Aug 1, 2023

This issue serves as a way to keep track of parts of Pollen programs (see #134) that are not currently parsed correctly. To remedy this, either the Pollen language or the Pollen parser should be changed.

  • Declaring a graph with graph my_graph
  • Declaring an output set for a graph with parset ...
  • For loops: for x in y
  • Initializing variables without a type annotation (i.e., my_bool: bool = false; parses, but my_bool = false; fails)
  • Conditional statements: both if and if ... else ...
  • Methods for data structures (i.e., push for Strands and length for List<...>s, etc.
  • Instantiating an empty Strand with Strand(), i.e., x: Strand = Strand();
  • Declaring an output set for a graph analysis with outset ... (or whatever word we end up using)

This list may not be complete, but it should be enough for us to get the ball rolling and we can update as we go!

@sampsyo
Copy link
Collaborator

sampsyo commented Aug 2, 2023

Great; thanks! One minor question:

  • Initializing variables without a type annotation (i.e., my_bool: bool = false; parses, but my_bool = false; fails)
  • Parsing a new Strand: syntax in the example programs is currently x = Strand();, but the parser only parses x: Strand = Strand;

These sound like the same issue to me: i.e., all variable declarations need a type. So the syntax only supports <ident>: <type> = <expr> but not <ident> = <expr>. Is that right? (And separately, if so, can we work around this for now by just adding explicit types everywhere?)

@priyasrikumar
Copy link
Contributor Author

The second bullet point was meant to capture that instantiating a Strand using the Strand() syntax (with parens) doesn't work. In particular, we can parse x: Strand = Strand, but not x: Strand = Strand(). I see how that's a bit unclear with the current wording. I will reword that point so that it's more clearly about that specific issue!

@sampsyo
Copy link
Collaborator

sampsyo commented Aug 3, 2023

Got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants