Skip to content

Conversation

@wesleytodd
Copy link
Member

Figured I would take a stab at adding some tokens for the scope parens. This fails tests, and also adds new tokens not in the grammar yet, but I figured I would see if this is how you all were thinking of solving this before I added the other parts. Let me know what you think.

@wesleytodd wesleytodd requested review from bcoe and byCedric February 27, 2021 02:45
Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple notes, this looks like a great start to me though 👍

  • we might not need to add new tests, but will need to update the snapshots and make sure they have the appropriate new nodes.
  • let's perhaps update the grammar in the README to replace ( and ) with their expansion?

let s = scope(scanner)
if (s instanceof Error) {
// ... <scopeStart> <scope> <scopeEnd> ...
let ss = scopeStart(scanner)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be tempted to pull scope-start an scope-end into the scope parser, replacing the current logic that just ignores ( and ).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same thing, and did so at first, the issue was I didn't see an example of returning multiple tokens. I can have it return an array or error, but that would be a new api in here. Is that the direction we want to go?

}

/*
* <scopeEnd> ::= ")"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to match the rest of the grammar, I'd probably make it <scope-start>/<scope-end>.

Copy link

@RAI-Dev369 RAI-Dev369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@RAI-Dev369
Copy link

ok

Copy link

@RAI-Dev369 RAI-Dev369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@bcoe
Copy link
Member

bcoe commented Jan 12, 2022

Don't know how this found it's way back into my inbox today 😆

Is this still something you'd like to see over finish line @wesleytodd?

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

Successfully merging this pull request may close these issues.

4 participants