From aa5d7ac332d502eda854a69b3baa9bc6bb1293c6 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 11 Nov 2012 06:31:18 +0100 Subject: support for Qx, Ux, %x and Mx commands * Mx does not yet use local Q-registers --- parser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'parser.cpp') diff --git a/parser.cpp b/parser.cpp index 870a611..e37722e 100644 --- a/parser.cpp +++ b/parser.cpp @@ -10,6 +10,8 @@ #include "qbuffers.h" #include "parser.h" +//#define DEBUG + gint macro_pc = 0; namespace States { @@ -40,6 +42,12 @@ bool macro_execute(const gchar *macro) { while (macro[macro_pc]) { +#ifdef DEBUG + g_printf("EXEC(%d): input='%c'/%x, state=%p\n", + macro_pc, macro[macro_pc], macro[macro_pc], + States::current); +#endif + if (!State::input(macro[macro_pc])) { message_display(GTK_MESSAGE_ERROR, "Syntax error \"%c\"", @@ -193,6 +201,10 @@ StateStart::StateStart() : State() transitions['^'] = &States::control; transitions['E'] = &States::ecommand; transitions['I'] = &States::insert; + transitions['Q'] = &States::getqreginteger; + transitions['U'] = &States::setqreginteger; + transitions['%'] = &States::increaseqreg; + transitions['M'] = &States::macro; } void -- cgit v1.2.3