コード例 #1
0
ファイル: formula_lexer.cpp プロジェクト: Distrotech/libixion
void tokenizer::numeral()
{
    const char* p = mp_char;
    push_pos();

    size_t len = 1;
    size_t sep_count = 0;
    for (next(); has_char(); next(), ++len)
    {
        if (*mp_char == ':')
        {
            // Treat this as a name.  This may be a part of a row-only range (e.g. 3:3).
            pop_pos();
            name();
            return;
        }

        if (is_digit(*mp_char))
            continue;
        if (is_decimal_sep(*mp_char) && ++sep_count <= 1)
            continue;

        break;
    }

    if (sep_count > 1)
    {
        ostringstream os;
        os << "error parsing numeral: " << std::string(p, len);
        throw formula_lexer::tokenize_error(os.str());
    }
    double val = global::to_double(p, len);
    m_tokens.push_back(new lexer_value_token(val));
}
コード例 #2
0
void mod_node_impl::set_position(node_position const& pos)
{
    //NOTE: no call to node_impl::set_position at all!
    
    // freeze logic
    push_pos(pos);    
    delayed_send_ = true;

    on_position(msg::node_pos_msg(manager_->update_time(), ct_all, pos)); // just my system
}
コード例 #3
0
ファイル: dbglabls.cpp プロジェクト: VWarlock/zx-evo
INT_PTR CALLBACK LabelsDlg(HWND dlg, UINT msg, WPARAM wp, LPARAM lp)
{
   ::dlg = dlg;
   if (msg == WM_INITDIALOG)
   {
      *curlabel = 0;
      ShowLabels();
      return 1;
   }

   if (msg == WM_SYSCOMMAND && (wp & 0xFFF0) == SC_CLOSE) EndDialog(dlg, 0);

   if (msg == WM_VKEYTOITEM)
   {
      unsigned sz = strlen(curlabel);
      wp = LOWORD(wp);
      if (wp == VK_BACK) {
         if (sz) curlabel[sz-1] = 0, ShowLabels();
         else { deadkey: Beep(300, 100); }
      } else if ((unsigned)(wp-'0') < 10 || (unsigned)(wp-'A') < 26 || wp == '_') {
         if (sz == sizeof(curlabel)-1) goto deadkey;
         curlabel[sz] = wp, curlabel[sz+1] = 0, ShowLabels();
         if (!lcount) { curlabel[sz] = 0, ShowLabels(); goto deadkey; }
      } else return -1;
      return -2;
   }

   if (msg != WM_COMMAND) return 0;

   unsigned id = LOWORD(wp), code = HIWORD(wp);
   if (id == IDCANCEL || id == IDOK) EndDialog(dlg, 0);

   if (id == IDOK || (id == IDC_LABELS && code == LBN_DBLCLK))
   {
      HWND list = GetDlgItem(dlg, IDC_LABELS);
      unsigned n = SendMessage(list, LB_GETCURSEL, 0, 0);
      if (n >= lcount) return 0;
      char zz[0x400]; SendMessage(list, LB_GETTEXT, n, (LPARAM)zz);
      unsigned address; sscanf(zz, "%X", &address);

      void push_pos(); push_pos();
      CpuMgr.Cpu().trace_curs = CpuMgr.Cpu().trace_top = address;
      activedbg = WNDTRACE;

      EndDialog(dlg, 1);
      return 1;
   }

   return 0;
}