bool KeyboardControl::OnCommand(unsigned id, unsigned code) { if (id >= 0x20 && on_character != NULL) { on_character((TCHAR)id); return true; } else return ContainerWindow::OnCommand(id, code); }
// character ::= ' c ' // // TODO: Allow for unicode characters? Imrove error // handling. // // FIXME: Move the diagnostics into the semantic // action for character tokens. We might actually // want to support multicharacter literals. Token Lexer::character() { assert(peek() == '\''); get(); // ' if (peek() == '\\') // consume an escape. get(); get(); // c if (peek() != '\'') throw std::runtime_error("invalid character literal"); get(); // ' return on_character(); }
bool CharacterButton::OnClicked() { on_character(character); return true; }