[MLton] mlb path maps ... and spaces

Matthew Fluet fluet at tti-c.org
Fri Sep 5 15:46:52 PDT 2008


On Fri, 5 Sep 2008, Vesa Karvonen wrote:
> On Fri, Sep 5, 2008 at 5:55 PM, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
>> Could we change the semantics to be: cut first word up to first whitespace
>> => that's the variable. Trim leading and trailing whitespace of the
>> remainder => that's the path? It would require changing the "specification",
>> but would be backwards compatible.
>
> Sounds reasonable to me, but don't forget to trim leading whitespace
> from the variable name.

I would make the syntax for an mlb-path-map path the same as an mlb path:

   Paths may include path variables and are expanded according to a path
   map.  Unquoted paths may include alpha-numeric characters and the
   symbols "-" and "_", along with the arc separator "/" and extension
   separator ".". More complicated paths, including paths with spaces, may
   be included by quoting the path with ". A quoted path is lexed as an SML
   string constant.

That is, if we let [[:file:]] denote the epoynmous regexp from 
<src>/front-end/mlb.lex and let [[:smlstring:]] be a regexp for SML string 
constants, then an mlb-path-map entry line could be taken by the regexp:

^[[:space:]]*\([A-Z_][A-Z0-9_]*\)[[:space:]]+\([[:file:]]\|[[:smlstring:]]\)[[:space:]]$

> It would probably be useful to allow comments in a mlb-path-map file.

That might be nice.




More information about the MLton mailing list