[MLton-user] bug with path variables in mlb files
John Reppy
jhr at cs.uchicago.edu
Tue Nov 6 07:09:45 PST 2007
You should probably allow multiple "." in path names and disallow
pathnames
that start with "-". Then you've covered the POSIX portable pathnames.
It would also be nice if one could directly specify a pathvar on the
command line, instead of having to create a pathmap file.
- John
On Nov 6, 2007, at 8:42 AM, Matthew Fluet wrote:
> On Tue, 6 Nov 2007, Vesa Karvonen wrote:
>> I took the liberty of fixing this by allowing digits in path
>> variables:
>>
>> http://mlton.org/pipermail/mlton-commit/2007-November/002129.html
>>
>> So, just svn up, rebuild, install the compiler, and the problem
>> disappears.
>>
>> -Vesa Karvonen
>>
>> On Nov 6, 2007 1:36 PM, John Reppy <jhr at cs.uchicago.edu> wrote:
>>> It appears that a path variable like $(SML3D_LIB) is not
>>> considered a
>>> valid token by mlton. [...]
>
> I don't think there was ever a reason to disallow digits in path
> variables. I don't know that additional symbols would be
> desirable, though I guess one could make the claim for them.
> Vesa's patch makes the lexical conventions for MLBasis files:
>
> pathvar="$("([A-Z_][A-Z0-9_]*)")";
> filebase=({pathvar}|[-A-Za-z_0-9])+;
> fileext=({pathvar}|[-A-Za-z_0-9])+;
> filename={filebase}("."{fileext})*;
> arc=({pathvar}|{filename}|"."|"..");
> relpath=({arc}"/")*;
> abspath="/"{relpath};
> path={relpath}|{abspath};
> file={path}{filename};
>
> That falls short of the full range of UNIX paths (since we rule out
> most special characters). But, one can also use put file names in
> " (quotes) for an arbitrary file name, in which case they are lexed
> as SML string constants.
>
More information about the MLton-user
mailing list