Changeset 173cc427d9ebc67649d03cc132ed1931faf591a4

Show
Ignore:
Timestamp:
06/02/2008 10:38:56 AM (7 months ago)
Author:
mitchell <mitchell@frost.(none)>
git-committer:
mitchell <mitchell@frost.(none)> 1212428336 -0400
git-parent:

[8941b205b6eb1cff7ddb4ee1e43a88897427653a]

git-author:
mitchell <mitchell@frost.(none)> 1212428336 -0400
Message:

Added contitional to 'code' action in common.rl.
For quirky languages such as VIM where a character can be multiple entries to an
entity, (in VIM's case, '"' can be both a comment and string entity), the
scanner will see it is both a comment (if only whitespace has been observed) and
a string and call 'code' and 'comment' actions. The comment action is called
first and whole_line_comment is set, but previously the code action never
checked if whole_line_comment was set because I never forsaw this kind of
confusion and line_contains_code would also be set.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ext/ohcount_native/ragel_parsers/common.rl

    r06866e4 r173cc42  
    2626action code { 
    2727  if (!line_contains_code && !line_start) line_start = ts; 
    28   line_contains_code = 1; 
     28  if (!whole_line_comment) line_contains_code = 1; 
    2929} 
    3030 
     
    4848  p == buffer || *(p-2) == '\r' || *(p-2) == '\n' || *(p-2) == '\f' 
    4949} 
     50 
    5051}%%