News for hackers. Stuff that matters.
Re:How to Parse Ruby by Scaevolus on Thursday February 07, 2013 @03:11PM (#5184240)
Indentation is handled by the lexer, not the parser.

The parser is context free-- LL(1), actually.

The lexer maintains one extra stack to track indentations, meaning it's more of a PDA than a DFA, but the actual complication is mild.

Re:How to Parse Ruby by peterwoo on Thursday February 07, 2013 @05:43PM (#5185008)
The language is not context free, although I agree there is a parsing solution which is not terribly complex.
Re:How to Parse Ruby by lucian1900 on Friday February 08, 2013 @04:53AM (#5187084)
It is context free. INDENT and OUTDENT are directly equivalent to { and } in other grammars.
Re:How to Parse Ruby by peterwoo on Saturday February 09, 2013 @02:01AM (#5191965)
The difference is that INDENT and OUTDENT have to be defined by context-sensitive productions. Even if this occurs in what would otherwise be the "lexing" stage of the parser.