Changeset e778b278bdac7b0f65236bcdaf2e84a670148de8

Show
Ignore:
Timestamp:
06/04/2008 11:45:55 AM (7 months ago)
Author:
mitchell <mitchell@frost.(none)>
git-committer:
mitchell <mitchell@frost.(none)> 1212605155 -0400
git-parent:

[fcb57d7a8b5a6803e6cd63147bceebed67c1d518]

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

Fixed MATLAB parser and unit tests to include GNU Octave comments.

Files:

Legend:

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

    rad3c972 re778b27  
    4545  } 
    4646 
    47   matlab_line_comment = '%' [^{] @{ fhold; } @comment nonnewline*; 
     47  # note: the '#' comment is for GNU Octave 
     48  matlab_line_comment = ('%' [^{] @{ fhold; } | '#') @comment nonnewline*; 
    4849  matlab_block_comment = 
    4950    '%{' @comment ( 
  • test/unit/matlab_test.rb

    rdf3686a re778b27  
    66    lb = [Ohcount::LanguageBreakdown.new("matlab", "", "%comment", 0)] 
    77    assert_equal lb, Ohcount::parse(" %comment", "matlab") 
     8  end 
     9 
     10  def test_octave_syntax_comment 
     11    lb = [Ohcount::LanguageBreakdown.new("matlab", "", "#comment", 0)] 
     12    assert_equal lb, Ohcount::parse(" #comment", "matlab") 
    813  end 
    914