diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-10-30 02:28:42 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-10-30 02:28:42 +0000 |
| commit | ebd5401d7aa2b372a13bc539593a90683768dedc (patch) | |
| tree | a7738686d9d4efc0aa2df4dc39b5ce4e02105858 /statemachine.py | |
| parent | a89049a284faf8bb70d49291d5a305752a69cf31 (diff) | |
| download | docutils-ebd5401d7aa2b372a13bc539593a90683768dedc.tar.gz | |
Made "context" a parameter to ``StateMachine.run()``.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils/docutils@866 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'statemachine.py')
| -rw-r--r-- | statemachine.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/statemachine.py b/statemachine.py index 63f35c741..19c357d06 100644 --- a/statemachine.py +++ b/statemachine.py @@ -172,7 +172,7 @@ class StateMachine: state.unlink() self.states = None - def run(self, input_lines, input_offset=0): + def run(self, input_lines, input_offset=0, context=None): """ Run the state machine on `input_lines`. Return results (a list). @@ -190,6 +190,7 @@ class StateMachine: - `input_lines`: a list of strings without newlines. - `input_offset`: the line offset of `input_lines` from the beginning of the file. + - `context`: application-specific storage. """ self.runtime_init() self.input_lines = input_lines @@ -199,7 +200,6 @@ class StateMachine: if self.debug: print >>sys.stderr, ('\nStateMachine.run: input_lines:\n| %s' % '\n| '.join(self.input_lines)) - context = None transitions = None results = [] state = self.get_state() |
