[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextRider.ReadString not require quotes



> From: Ian Rae <ianrae@istar.ca>
> Date: Fri, 26 Jun 1998 22:28:08 -0400
> 
> While we're working on TextRider, here's a suggestion:
> 
> Could an option be added that dropped the requirement
> for strings to be enclosed in single or double quotes in
> ReadString?
> 
> When enabled, ReadString and WriteString would be
> symmetric.

You must provide a specification for your strings, e.g. a regular
expression.  Then you should reconsider if the result is truely
symmetric.

> More importantly, one would be able to use TextRider
> to parse ordinary tokens (i.e. anything separated by
> whitespace).  For example, I wanted to read a list
> of module names, selected in a Bbox text
> 
> TextRider.Mod In.Mod Out.Mod
> 
> Amazingly one could not easily do this with TextRider!
> Either one had to wrap the module names in quotes or
> do ReadChar (!) or ReadIdent (doesn't work if module starts
> with a digit!).

Since when can module names start with a digit?  I believe, Scanner
will give you what you want (although it will choke on
2module.command). 

> The current behaviour appears to be historical -- Wirth's In.Mod?

Mostly.  In fact, TextRider provides scanners (the Reader is a
scanner, too), which explains many of the "unusual" features.

-- mva