Change in resolution of ambiguous matches

2 views
Skip to first unread message

Dave F

unread,
Jul 29, 2010, 10:58:02 PM7/29/10
to StorEvil
Howdy folks.

I've changed the way that StorEvil handles ambiguous matches (when
multiple methods exist that can fulfill a line of plain text).

Previously, an exception was thrown.

Now, it will prefer methods that are on context classes that have been
used already in the scenario, on a most recently used basis.

For example, with the following context classes:

[Context]
public class FooContext {
public void using_foo() {}
public void when_I_do_something() {}
}

[Context]
public class BarContext {
public void using_bar() {}
public void when_I_do_something() {}
}

...

Scenario: methods on context classes that have been used already are
preferred
using foo
# invokes FooContext.When_I_do_something
when i do something

Scenario: the most recently used context class is selected
using foo
using bar
# invokes BarContext.When_I_do_something
when i do something

Scenario: an exception is thrown when neither context has been used
# throws MethodResolutionException
when i do something

...

This way you are free to create whatever syntax you would like for the
"using foo/bar" by just adding an empty method to a class.
Reply all
Reply to author
Forward
0 new messages