Changeset 3954 for to-imperative


Ignore:
Timestamp:
Oct 2, 2008, 7:39:37 PM (12 years ago)
Author:
yura
Message:
  • Attributes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/refal/refal/plus/XML.rf

    r3953 r3954  
    2929  };
    3030
     31$func SplitAttrs e = e;
     32SplitAttrs e.attrs,
     33  () (e.attrs) $iter {
     34    e.attrs : e.key '=' '"' e.value '"' e.tail,
     35      { e.tail : ' ' e.tail1 = e.tail1; e.tail; } :: e.tail,     
     36      (e.keyvalues (<ToWord e.key> <ToWord e.value> )) (e.tail);
     37  } :: (e.keyvalues) (e.attrs),
     38  e.attrs : /* empty */ =
     39  e.keyvalues;
     40
    3141$func SplitName e = (e) e;
    3242
    3343SplitName {
    34   e.name ' ' e.attrs = (e.name) e.attrs;
     44  e.name ' ' e.attrs = (e.name) <SplitAttrs e.attrs>;
    3545  e.name = (e.name);
    3646};
     
    4151  '<' e.name '/>' =
    4252    <SplitName e.name> :: (e.name) e.attrs,
    43     (<ToWord e.name> <ToWord e.attrs>);
     53    (<ToWord e.name> ((ATTRIBUTES) e.attrs));
    4454  '<' e.name '>' =
    4555    <SplitName e.name> :: (e.name) e.attrs,
    4656    <GetTag s.stream> $iter e.text <ReadTag s.stream e.tag> <GetTag s.stream> :: e.text (e.tag),
    4757    e.tag : '</' e.name '>',
    48     (<ToWord e.name> <ToWord e.attrs> e.text);
     58    (<ToWord e.name> ((ATTRIBUTES) e.attrs) e.text);
    4959};
    5060
Note: See TracChangeset for help on using the changeset viewer.