next = new MPlist ();
}
+ public MPlist (FileStream stream, MSymbol stop)
+ {
+ MStreamReader reader = new MStreamReader (stream);
+ bool result;
+
+ key = MSymbol.nil;
+ val = null;
+ while (true)
+ {
+ MSymbol this_key;
+ object this_val;
+
+ result = reader.ReadElement (out this_key, out this_val);
+ if (! result)
+ return;
+ if (this_key == MSymbol.plist)
+ {
+ MPlist plist = (MPlist) this_val;
+
+ if (plist.IsSymbol && plist.Symbol == stop)
+ return;
+ }
+ key = this_key;
+ val = this_val;
+ next = new MPlist (reader, stop);
+ }
+ }
+
public MPlist (FileStream stream, MSymbol target, MSymbol stop)
{
MStreamReader reader = new MStreamReader (stream);
next = new MPlist ();
}
+ private MPlist (MStreamReader reader, MSymbol stop)
+ {
+ bool result;
+ MPlist next_plist = null;
+
+ key = MSymbol.nil;
+ val = null;
+ while (true)
+ {
+ MSymbol this_key;
+ object this_val;
+
+ result = reader.ReadElement (out this_key, out this_val);
+ if (! result)
+ return;
+ if (this_key == MSymbol.plist)
+ {
+ MPlist plist = (MPlist) this_val;
+
+ if (plist.IsSymbol && plist.Symbol == stop)
+ return;
+ }
+ if (next_plist == null)
+ {
+ key = this_key;
+ val = this_val;
+ next = next_plist = new MPlist ();
+ }
+ else
+ {
+ next_plist.key = this_key;
+ next_plist.val = this_val;
+ next_plist.next = new MPlist ();
+ next_plist = next_plist.next;
+ }
+ }
+ }
+
private MPlist (MStreamReader reader, MSymbol target, MSymbol stop)
{
bool result;
val = new MPlist (this);
key = MSymbol.plist;
}
- else if (c == '"' || c == '\\')
+ else if (c == '"')
{
MText mt;
ReadMText (out mt);