From: Jean-Hugues ROBERT Date: 2002-05-09T22:40:23+09:00 Subject: Re: [Q] non-alphabetic character in symbol At 22:11 09/05/2002 +0900, you wrote: >At Thu, 9 May 2002 21:53:31 +0900, >Jean-Hugues ROBERT wrote: > > > > What about: > > > > :+symbol: > > > > > > > > Syntax: > > > > either :A_WORD[:] > > > > or :WhatEver: > > > > > >I guess it's not good for ::WhatEver:, because of parser's > > >implemetation. > > >Nobu Nakada > > Well... :\:Whatever: (and also :\\Whatever: for that matter). Seems >Also it may change meanings of foo?:Foo:bar, not? >Nobu Nakada Yes, that construct could generate an error because foo ? :Foo: bar is missing a :. > > to me that this is rather a lexer issue than a parser one (for what > > its worth). >Perhaps, but it is mixed in parse.y and would be hard to >separate for Ruby syntax. I trust you on that. If the lexer gets help from the parser than it can probably figure out that the optional [:] of Symbol is actually the : of the ? ternary expression. Not that I advocate for context dependent lexical analysis... (though it is cool sometimes). So... lets forget about :WhatEver: Yours, JHR ------------------------------------------------------------------------- Web: http://hdl.handle.net/1030.37/1.1 Phone: +33 (0) 4 92 27 74 17