Changeset 338ef7cbc6c092d5abce7091de645f7eb53e42b6
- Timestamp:
- 02/04/2008 01:01:53 PM
(1 year ago)
- Author:
- Robin Luckey <robin@Tangier.local>
- git-committer:
- Robin Luckey <robin@Tangier.local> 1202158913 -0800
- git-parent:
[0a6219f5af01f5b222bd50cf1962c149ae0bed84]
- git-author:
- Robin Luckey <robin@Tangier.local> 1202158913 -0800
- Message:
[FIX] Haskell was missing a declaration for its nice_name.
There should probably be a test for this, but I can't figure out
how to get a list of all Monoglots at test time.
Language nice_names and categories should probably be declared
somewhere more obvious anyway.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r596bf87 |
r338ef7c |
|
| 120 | 120 | * In Ohcount::Generator, instantiate a new Ohcount::Monoglot or |
|---|
| 121 | 121 | Ohcount::Polyglot to parse the language. |
|---|
| | 122 | * In Ohcount::SlocInfo, provide a "nice name" and category (procedural |
|---|
| | 123 | code vs. markup) for the new language. |
|---|
| 122 | 124 | * Create a new Ohcount::Test to verify the parser. |
|---|
| 123 | 125 | |
|---|
| rc094fe9 |
r338ef7c |
|
| 1 | | # a DTO class to hold the sloc information |
|---|
| | 1 | # A generic data object for returning parsing results from Ohcount to Ohloh. |
|---|
| | 2 | # |
|---|
| | 3 | # This class has the additional job of declaring a "nice" (human readable) name |
|---|
| | 4 | # for each language, as well as the category (procedural code vs. markup) for each |
|---|
| | 5 | # language. These features should probably live elsewhere, and are currently |
|---|
| | 6 | # not covered by unit tests. |
|---|
| 2 | 7 | class Ohcount::SlocInfo |
|---|
| 3 | 8 | attr_reader :language |
|---|
| … | … | |
| 71 | 76 | 'xslt' => {:nice_name => 'XSL Transformation',:category => 0}, |
|---|
| 72 | 77 | 'dmd' => {:nice_name => 'D' , :category => 0}, |
|---|
| 73 | | 'tex' => {:nice_name => 'TeX/LaTeX' , :category => 1} |
|---|
| | 78 | 'tex' => {:nice_name => 'TeX/LaTeX' , :category => 1}, |
|---|
| | 79 | 'haskell' => {:nice_name => 'Haskell' , :category => 0} |
|---|
| 74 | 80 | } |
|---|
| 75 | 81 | |
|---|
| | 82 | # Returns the human readable name for a language. |
|---|
| 76 | 83 | def language_nice_name |
|---|
| 77 | 84 | @@lang_map[self.language][:nice_name] |
|---|
| 78 | 85 | end |
|---|
| 79 | 86 | |
|---|
| | 87 | # Returns the category (procedural code vs. markup) for a language. |
|---|
| | 88 | # |
|---|
| | 89 | # Category 0 indicates procedural code (most languages). |
|---|
| | 90 | # Category 1 indicates a markup file, such as XML. |
|---|
| 80 | 91 | def language_category |
|---|
| 81 | 92 | @@lang_map[self.language][:category] |
|---|