# Warning: the following style issues were flagged by pep8:
#	src/parser/matlab/scope.py:20:1: E302 expected 2 blank lines, found 1
#	src/parser/matlab/scope.py:52:72: E203 whitespace before ':'
#	src/parser/matlab/mat_parse.py:4:9: W291 trailing whitespace
#	src/parser/matlab/mat_parse.py:27:1: E901 TokenError: EOF in multi-line statement
# Please consider fixing the issues listed above before committing.
# If you run into a situation where pep8 flags a line but it really
# should not, or you prefer to leave that line as-is, add the
# comment '# noqa' at the end of that line to make pep8 ignore it.
New class for tracking scopes.

Rather than attaching a bunch of attributes directly to ParseResults
structures, we can gather them into a class object.  This file
implements that class, named "Scope" for a lack of better names.  It
provides some basic methods to manipulate the scope.

The intention is to attach an instance of a Scope object to a
ParseResults structure under an attribute named "scope", so that the
stuctures can be accessed as, e.g., "pr.scope".
Improved handling of contexts.

Rather than attaching a bunch of attributes directly to ParseResults
structures, this now gathers attributes into an object of class
"Scope".  This not only modularizes things more sensibly; it also ends
up simplifying the code in here.
Ignore my personal NoteBook file.
Removed some debugging code.
Renamed field 'assignments' back to 'variables'.

I can't make up my mind which one makes more sense. Today, 'variables'
makes more sense, so there you go.
Forgot to fix print function to handle new scope/context scheme.
Added a simple formatted printer.
I was wrong; we don't want to run pep8 as a pre-commit hook.

Better to do such things on the prepare-commit-msg hook instead. I'll
check in separate code for that.
Added prepare-commit-msg hook script.
Huge enhancement.

1. Added properties and getters and setters.
2. Create ScopeDict class to hold values that are dictionaries.
Updated to new improved Scope class.
Modified to work with new scope scheme in the parser.
Fixed pep8 warnings.
Removed debugging stops.
Removed debugging stops.
Fixed bug in ScopeDict subclass & added documentation.

ScopeDict had a second __setitem__ method.  Not sure why this didn't
cause problems.  Maybe because the 2nd definition overwrote the first?
Fixed broken print_parse_results().

Turns out it wasn't properly adapted to the new context scheme.  Now it
should be better.
Fixed bugs in parsing machinery

1) Bug fix: Added  import to 'grammar_utils class'
2) Updated referenced and methods in class 'run-syntax-tests'. Tested
with all test-cases (unresolved bugs have been reported in the google
group).
3) Bug fix: method '_store_stmt' of 'grammar' class modified to support
function definitions that have no arguments but a return type (e.g.,
function[Y]=valid_51).
Added testing framework for converter class

1) Added a converter-tests-cases folder under converter with matlab
examples containing ODE models with different kinetics (more will be
added later).
2) Also added a run-converter-tests.py class that emulates the testing
framework in place for the parser.
Merging 'improve-context-handling' branch.
New code + fixes from Harold.