|
|
>> Other amusing edge cases include "/":
>>
>> - A name is usually executable; by preceeding it with "/", it becomes
>> literal.
>>
>> - The toke "/" by itself (i.e., not preceeding a name) is a valid
>> (executable) name.
>>
>> Trixy Hobbitses!
>
> Also fun is trying to write a correct number parser:
>
> - ".0" and "0." are both real number objects (equal to 0.0).
>
> - "." by itself is a name object.
>
> - PostScript allows both "-" and "+" as sign prefixes (which is good).
> Haskell does not, however (which is bad).
Ah, but these interact!
Anything that isn't parsable as a number is a name. Therefore,
"0." -> real
".0" -> real
"." -> name
"1.1" -> real
"1.1.1" -> name
"1e1" -> real
"1x1" -> name
"s1" -> name
"1s" -> name
Will the insanity never end?? >_<
Good luck writing a parser that can untangle all of that... :-(
Post a reply to this message
|
|