diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-19 14:10:40 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:32 +0100 |
commit | 9d8b90f654b5777f5c9d402fda445088f9fe374f (patch) | |
tree | 61c7c63b725046b9458fa444e9cfa1cb1b7d3969 /parser.cpp | |
parent | 6dbf365f144df4a55294244b1a1cd6f679992456 (diff) | |
download | sciteco-9d8b90f654b5777f5c9d402fda445088f9fe374f.tar.gz |
Scintilla command ES accepting string parameter: if empty, pop value from stack otherwise pass string
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
@@ -23,6 +23,7 @@ namespace States { StateFlowCommand flowcommand; StateCondCommand condcommand; StateECommand ecommand; + StateScintilla scintilla; StateInsert insert; StateSearch search; @@ -1052,8 +1053,9 @@ StateECommand::StateECommand() : State() { transitions['\0'] = this; transitions['B'] = &States::editfile; - transitions['W'] = &States::savefile; + transitions['S'] = &States::scintilla; transitions['Q'] = &States::eqcommand; + transitions['W'] = &States::savefile; } State * @@ -1073,20 +1075,6 @@ StateECommand::custom(gchar chr) throw (Error) ring.close(); break; - case 'S': { - BEGIN_EXEC(&States::start); - expressions.eval(); - if (!expressions.args()) - throw Error("<ES> command requires at least a message code"); - - unsigned int iMessage = expressions.pop_num_calc(1, 0); - uptr_t wParam = expressions.pop_num_calc(1, 0); - sptr_t lParam = expressions.pop_num_calc(1, 0); - - expressions.push(interface.ssm(iMessage, wParam, lParam)); - break; - } - case 'X': BEGIN_EXEC(&States::start); @@ -1105,6 +1093,28 @@ StateECommand::custom(gchar chr) throw (Error) return &States::start; } +State * +StateScintilla::done(const gchar *str) throw (Error) +{ + unsigned int iMessage; + uptr_t wParam; + sptr_t lParam; + + BEGIN_EXEC(&States::start); + + expressions.eval(); + if (!expressions.args()) + throw Error("<ES> command requires at least a message code"); + + iMessage = expressions.pop_num_calc(1, 0); + wParam = expressions.pop_num_calc(1, 0); + lParam = *str ? (sptr_t)str : expressions.pop_num_calc(1, 0); + + expressions.push(interface.ssm(iMessage, wParam, lParam)); + + return &States::start; +} + /* * NOTE: cannot support VideoTECO's <n>I because * beginning and end of strings must be determined |