[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unify the lexer's idea of words and commands across all modes. (issu
From: |
Trevor Daniels |
Subject: |
Re: Unify the lexer's idea of words and commands across all modes. (issue 6445056) |
Date: |
Tue, 31 Jul 2012 17:57:00 +0100 |
<address@hidden> wrote Tuesday, July 31, 2012 11:52 AM
>> http://codereview.appspot.com/6445056/diff/1/lily/lexer.ll#newcode390
>> lily/lexer.ll:390: <chords,notes,figures>{RESTNAME}/[-_] |
>> Why is this trailing context added? I don't see
>> what this would match that wouldn't be matched
>> by the following line.
>
> Flex picks the longest matching pattern. Apparently that includes
> trailing contexts. Without this pattern, r-. does not trigger the
> {RESTNAME} rule but rather the {WORD}/[-_] rule coming later. And for
> the {WORD}/[-_] rule, the trailing context is needed to keep flex from
> requiring backup states.
Thanks. Understood. Probably worth a comment in the
code as this is not immediately obvious.
Trevor