Changeset 1140


Ignore:
Timestamp:
Aug 11, 2003, 1:42:33 AM (17 years ago)
Author:
orlov
Message:
  • rsplit macro has been added.
Location:
to-imperative/trunk/runtime
Files:
2 edited

Legend:

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

    r882 r1140  
    347347  Expr const& le = iter(e).get_left(); \
    348348  Expr const& re = iter(e).get_right()
     349 
     350#define rsplit(e, minlen, le, re) \
     351  SplitIterator<d_rt> iter(e)(e, minlen); \
     352  Expr const& le = iter(e).get_left(); \
     353  Expr const& re = iter(e).get_right()
    349354
    350355}
  • to-imperative/trunk/runtime/rf_expr.ih

    r1138 r1140  
    465465      _expr.get_mem_chunk(), _expr.get_flags()),
    466466  rt (_expr.get_first() + _min_len, _expr.get_last(),
     467      _expr.get_mem_chunk(), _expr.get_flags()),
     468  state (true)
     469{
     470//  if (_min_len == 0) lt.flags = FLAT_BIT;
     471}
     472
     473//
     474// explicit specialization for SplitIterator constructor with right splitting
     475template <>
     476inline SplitIterator<d_rt>::SplitIterator (
     477  Expr const& _expr, uintptr_t _min_len
     478) :
     479  lt (_expr.get_first(), _expr.get_last() - _min_len,
     480      _expr.get_mem_chunk(), _expr.get_flags()),
     481  rt (_expr.get_last() - _min_len, _expr.get_last(),
    467482      _expr.get_mem_chunk(), _expr.get_flags()),
    468483  state (true)
     
    834849      if (p != first) fputc(' ', _fp);
    835850      if (p->get_type() == type_ref) {
    836         if (fputs("( ", _fp) == EOF) return false;
     851        if (fputc('(', _fp) == EOF) return false;
    837852        Expr e(p);
    838853        if (!e.write(_fp)) return false;
    839         if (fputs(" )", _fp) == EOF) return false;
     854        if (fputc(')', _fp) == EOF) return false;
    840855      } else if (p->get_type() == type_word) {
    841856        WString ws = (WString)(*p);
Note: See TracChangeset for help on using the changeset viewer.