Enhancement - Integrated Subst

- Subst is now part of Context.
This commit is contained in:
Paul Beckingham 2009-06-07 00:39:50 -04:00
parent a2a9fa7f35
commit 049767484f
3 changed files with 15 additions and 10 deletions

View file

@ -42,6 +42,7 @@ Context::Context ()
, filter () , filter ()
, keymap () , keymap ()
, sequence () , sequence ()
, subst ()
, task () , task ()
, tdb () , tdb ()
, stringtable () , stringtable ()
@ -63,6 +64,7 @@ Context::Context (const Context& other)
filter = other.filter; filter = other.filter;
keymap = other.keymap; keymap = other.keymap;
sequence = other.sequence; sequence = other.sequence;
subst = other.subst;
task = other.task; task = other.task;
tdb = other.tdb; tdb = other.tdb;
stringtable = other.stringtable; stringtable = other.stringtable;
@ -82,6 +84,7 @@ Context& Context::operator= (const Context& other)
filter = other.filter; filter = other.filter;
keymap = other.keymap; keymap = other.keymap;
sequence = other.sequence; sequence = other.sequence;
subst = other.subst;
task = other.task; task = other.task;
tdb = other.tdb; tdb = other.tdb;
stringtable = other.stringtable; stringtable = other.stringtable;
@ -300,16 +303,17 @@ void Context::parse ()
} }
*/ */
/* // Substitution of description and/or annotation text.
// Substitution of description text. else if (subst.valid (*arg))
else if (validSubstitution (arg, from, to, global))
{ {
if (foundSequence) if (foundSequence)
foundSomethingAfterSequence = true; foundSomethingAfterSequence = true;
task.setSubstitution (from, to, global); std::cout << "# found subst" << std::endl;
subst.parse (*arg);
} }
/*
// Command. // Command.
else if (command == "") else if (command == "")
{ {
@ -326,6 +330,7 @@ void Context::parse ()
descCandidate += arg; descCandidate += arg;
} }
} }
*/
// Anything else is just considered description. // Anything else is just considered description.
else else
@ -335,10 +340,10 @@ void Context::parse ()
if (descCandidate.length ()) if (descCandidate.length ())
descCandidate += " "; descCandidate += " ";
descCandidate += arg; descCandidate += *arg;
} }
*/
} }
// terminated, therefore everything subsequently is a description. // terminated, therefore everything subsequently is a description.
else else
{ {
@ -354,9 +359,6 @@ void Context::parse ()
if (validDescription (descCandidate)) if (validDescription (descCandidate))
task.set ("description", descCandidate); task.set ("description", descCandidate);
// TODO Replace parse.cpp:parse
throw std::string ("unimplemented Context::parse");
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -31,6 +31,7 @@
#include "Keymap.h" #include "Keymap.h"
#include "Config.h" #include "Config.h"
#include "Sequence.h" #include "Sequence.h"
#include "Subst.h"
#include "T2.h" #include "T2.h"
#include "TDB2.h" #include "TDB2.h"
#include "StringTable.h" #include "StringTable.h"
@ -59,6 +60,7 @@ public:
Filter filter; Filter filter;
Keymap keymap; Keymap keymap;
Sequence sequence; Sequence sequence;
Subst subst;
T2 task; T2 task;
TDB2 tdb; TDB2 tdb;
StringTable stringtable; StringTable stringtable;

View file

@ -4,7 +4,8 @@ LFLAGS =
LIBS = LIBS =
OBJECTS = main.o ../Context.o ../TDB2.o ../T2.o ../Sequence.o ../Filter.o \ OBJECTS = main.o ../Context.o ../TDB2.o ../T2.o ../Sequence.o ../Filter.o \
../Att.o ../Keymap.o ../Record.o ../StringTable.o ../Location.o \ ../Att.o ../Keymap.o ../Record.o ../StringTable.o ../Location.o \
../util.o ../text.o ../Date.o ../Config.o ../Subst.o ../Nibbler.o ../util.o ../text.o ../Date.o ../Config.o ../Subst.o ../Nibbler.o \
../parse.o ../Duration.o ../T.o
all: $(PROJECT) all: $(PROJECT)