Browse thread
ocamllex and python-style indentation
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Mike Lin <nilekim@g...> |
| Subject: | Re: [Caml-list] ocamllex and python-style indentation |
On Tue, Jun 30, 2009 at 6:06 PM, Andreas Rossberg<rossberg@mpi-sws.org> wrote: > On Jun 30, 2009, at 22.19 h, Mike Lin wrote: >> >> More generally, you've got parentheses, comments, and string literals, >> and you need to know to ignore whitespace within any of those -- and >> to ignore e.g. an open parenthesis that occurs within a comment, or a >> close comment that occurs within a string literal. So inevitably >> you've got to lex and parse at some level to make this work for a >> practical language. > > Comments and string literals are no problem, since the lex wrapper will > never see anything inside them as separate tokens anyway. OCaml comments can be nested, and must be nested parenthetically. :)