[bitc-dev] Implementation of indentation-aware parse

Jonathan S. Shapiro shap at eros-os.com
Thu Feb 26 17:22:24 EST 2009


Thank you. That is informative. And yes, subject to that constraint I
know how to do this entirely in the lexer. It's a rather horrible
kludge, because context-sensitive lexing sucks, but it can be made to
work.

On Thu, Feb 26, 2009 at 5:17 PM, Geoffrey Irving <irving at naml.us> wrote:
> On Thu, Feb 26, 2009 at 2:14 PM, Jonathan S. Shapiro <shap at eros-os.com> wrote:
>> Does python permit things like:
>>
>> if x +
>>  y:
>>  do_something
>>
>> That is: can an expression have a newline in it after an operator? How
>> about after a comma in a parameter list (formal or actual)?
>>
>> What about:
>>
>> if x
>>  + y:
>>  do_something
>>
>> Is that allowed?
>>
>> If it's only allowed after an operator than I mostly know how to make
>> it work with a lexer kludge.
>
> Python rejects both of those: parentheses are required around any
> expression that contains a newline.  Once inside parentheses,
> whitespace is irrelevant.
>
> Geoffrey
> _______________________________________________
> bitc-dev mailing list
> bitc-dev at coyotos.org
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>


More information about the bitc-dev mailing list