[Omake] [Ping Jason] Why do we tokenize comments?

Jason Hickey jyh at cs.caltech.edu
Thu Feb 16 20:43:58 PST 2006


Sorry, maybe we can find another way.  Comments must be tokenized for 
the usual reason that the make language is not context-free.  For 
example, while the following is currently bugged, it is _supposed_ to do 
what you expect.

    clean:
       rm *.o *.a .#* *.lib

The lexer does not usually discard input.

    X = $"""
    # Hello world
    """

That's not a comment in there, etc.

Jason

Aleksey Nogin wrote:
> On 11.02.2006 15:36, Mikkel Fahnøe Jørgensen wrote:
> 
>> some-target :   # comment - yields invalid token error
> 
> 
> Specifically the error is "unexpected token: comment: # ...". So I am 
> wondering - why do we tokenize comments in the first place? Why not 
> simply ignore them during lexing?
> 
> Proposed patch is attached.



-- 
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257


More information about the OMake-Devel mailing list