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

allow synbot6 to respond to >1 item per utterance #6

Merged
merged 1 commit into from May 9, 2015

Conversation

masak
Copy link
Contributor

@masak masak commented May 1, 2015

It does this by setting up a grammar, parsing out the interesting bits, and responding to them in action methods.

The code that this replaces not only latches on to the first thing it sees, it also returns early (not considering
later things) if the first thing turned out to be uninteresting. This version does not do that.

After some consideration, I decided that the grammar rules should do as little as possible. Just the parsing.
The actions then get to decide whether the parsed-out item deserves a reaction of some sort.

Yes, the actions class is nested inside of the said method. This is the easiest way for it
to get privileged access to the method parameter $e.

An earlier version of this PR did something silly with dynamic variables. But that's fixed now.
arnsholt++ for suggesting the fix.

It does this by setting up a grammar, parsing out the interesting bits, and responding to them in action methods.

The code that this replaces not only latches on to the first thing it sees, it also *returns early* (not considering
later things) if the first thing turned out to be uninteresting. This version does not do that.

After some consideration, I decided that the grammar rules should do as little as possible. Just the parsing.
The actions then get to decide whether the parsed-out item deserves a reaction of some sort.

Yes, the actions class is nested inside of the `said` method. This is the easiest way for it
to get privileged access to the method parameter `$e`.
@tadzik
Copy link
Owner

tadzik commented May 9, 2015

Awesome :)

tadzik pushed a commit that referenced this pull request May 9, 2015
allow synbot6 to respond to >1 item per utterance
@tadzik tadzik merged commit b145dc9 into tadzik:master May 9, 2015
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.

None yet

2 participants