Changeset 754


Ignore:
Timestamp:
May 25, 2003, 8:55:08 PM (18 years ago)
Author:
luba
Message:
  • is_number() method is corrected
Location:
to-imperative/trunk/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/runtime/rf_word.hh

    r747 r754  
    4545  inline int is_number () const;
    4646
     47  inline const wchar_t* get_content () const;
     48
    4749  static Expr create_expr (wchar_t const* _wstr) ;
    4850
  • to-imperative/trunk/runtime/rf_word.ih

    r747 r754  
    9090}
    9191
     92inline const wchar_t* Word:: get_content () const {
     93  Header* h = static_cast<Header*>(ptr_data2);
     94  return h->content;
     95}
     96
     97
    9298
    9399//first symbol in word is '-' res == -1; '+' res == 1,
     
    104110  if ((h->content[i]) == '+') res = 1;
    105111  if (iswdigit(h->content[i])) res = 2;
    106   if (res) i = 1;
    107   for (; i < h->length; i++)
    108     if (iswdigit(h->content[i]) == 0) {
    109       res = 0;
    110       break;
    111     }
     112 
     113  if (res)
     114    i++;
     115    for (; i < h->length; i++)
     116      if (iswdigit(h->content[i])==0) {
     117        res = 0;
     118        break;
     119      }
    112120  return res;
    113121}
Note: See TracChangeset for help on using the changeset viewer.