Changeset 1182


Ignore:
Timestamp:
Aug 13, 2003, 9:27:57 AM (17 years ago)
Author:
pooh
Message:
  • Read!() fixes.
Location:
to-imperative/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/library/StdIO/read.cc

    r1158 r1182  
    111111      buf[i++] = wc;
    112112    }
    113   } else if (iswupper(wc)) {
     113  } else if (is_refal_upper(wc)) {
    114114    while (true) {
    115115      if (wc == L'\\') wc = read_escaped_char(_fp);
     
    122122      wc = get_char(_fp);
    123123      if (wc == WEOF) break;
    124       if (!iswalnum(wc) && wc != L'!' && wc != L'?' && wc != L'-') {
     124      if (!is_refal_alnum(wc)) {
    125125        unget_char(_fp, wc);
    126126        break;
     
    176176    return read_word(_fp);
    177177  default:
    178     if (iswupper(wc)) {
     178    if (is_refal_upper(wc)) {
    179179      unget_char(_fp, wc);
    180180      return read_word(_fp);
     
    201201        return true;
    202202      } catch (wint_t err) {
    203         return false;
     203        retfail;
    204204      }
    205205      //
     
    213213
    214214RF_FUNC (Read, (), (RF_RES _res))
    215   RF_CALL(Read_e_, (StdIn), (_res));
     215  RF_TAILCALL(Read_e_, (StdIn), (_res));
    216216RF_END
    217217
  • to-imperative/trunk/runtime/rf_expr.ih

    r1140 r1182  
    784784  if (*p == null) return false;
    785785  while ((wc = *p++) != null) {
    786     if (!iswalnum(wc) && wc != L'!' && wc != L'?' && wc != L'-') return false;
    787     if (first && !iswupper(wc)) return false;
     786    if (!is_refal_alnum(wc)) return false;
     787    if (first && !is_refal_upper(wc)) return false;
    788788    first = false;
    789789  }
  • to-imperative/trunk/runtime/rf_macros.hh

    r1180 r1182  
    11#ifndef __rf_macros_hh__
    22#define __rf_macros_hh__
     3
     4#include <wchar.h>
    35
    46namespace rfrt
     
    160162  }
    161163
     164static inline bool is_refal_alnum (wint_t _wc) {
     165  return iswalnum(wc) || wc == L'!' || wc == L'?' || wc ==;
     166}
     167
     168static inline bool is_refal_upper (wint_t _wc) {
     169  return iswupper(wc) || wc == L'!' || wc == L'?';
     170}
     171
    162172}
    163173
Note: See TracChangeset for help on using the changeset viewer.