Changeset 3695ff8cccdded552a1c5468e71253f9f12eb899
- Timestamp:
- 07/11/2008 01:49:12 AM
(6 months ago)
- Author:
- Fedor Korsakov <fedorkorsakov@fedor-korsakovs-computer.local>
- git-committer:
- Fedor Korsakov <fedorkorsakov@fedor-korsakovs-computer.local> 1215766152 -0500
- git-parent:
[32b8775b009de9d239164d3cc6d90cb12be2a4c5]
- git-author:
- Fedor Korsakov <fedorkorsakov@fedor-korsakovs-computer.local> 1215766152 -0500
- Message:
[FIX] Added docstring support to Lisp.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0b4bd62 |
r3695ff8 |
|
| 45 | 45 | } |
|---|
| 46 | 46 | |
|---|
| 47 | | lisp_comment = ';' @comment nonnewline*; |
|---|
| | 47 | lisp_docstring = '"'{3} @comment ( |
|---|
| | 48 | newline %{ entity = INTERNAL_NL; } %lisp_ccallback |
|---|
| | 49 | | |
|---|
| | 50 | ws |
|---|
| | 51 | | |
|---|
| | 52 | (nonnewline - ws) @comment |
|---|
| | 53 | )* :>> '"""' @comment; |
|---|
| 48 | 54 | |
|---|
| 49 | | lisp_string = |
|---|
| 50 | | '"' @code ( |
|---|
| | 55 | lisp_line_comment = ';' @comment nonnewline*; |
|---|
| | 56 | |
|---|
| | 57 | lisp_comment = lisp_line_comment | lisp_docstring; |
|---|
| | 58 | |
|---|
| | 59 | lisp_empty_string = |
|---|
| | 60 | '"'{2} [^"] @{fhold;} @code; |
|---|
| | 61 | |
|---|
| | 62 | lisp_char_string = |
|---|
| | 63 | '"' [^"] '"' @code; |
|---|
| | 64 | |
|---|
| | 65 | lisp_regular_string = |
|---|
| | 66 | '"' ([^"]{2}) @code ( |
|---|
| 51 | 67 | newline %{ entity = INTERNAL_NL; } %lisp_ccallback |
|---|
| 52 | 68 | | |
|---|
| … | … | |
| 57 | 73 | '\\' nonnewline @code |
|---|
| 58 | 74 | )* '"'; |
|---|
| | 75 | |
|---|
| | 76 | lisp_string = lisp_empty_string | lisp_char_string | lisp_regular_string; |
|---|
| 59 | 77 | |
|---|
| 60 | 78 | lisp_line := |* |
|---|
| rb4f9575 |
r3695ff8 |
|
| 1 | 1 | ;;; CrapsSim.lsp |
|---|
| 2 | | ;;; The main purpose of this program was to implement a Craps game, using a language that we have just |
|---|
| 3 | | ;;; learned. Also, it was written in a functional style with almost no reliance on the assignment |
|---|
| 4 | | ;;; operation. Only one local variable called THROW was used. |
|---|
| | 2 | """ |
|---|
| | 3 | The main purpose of this program was to implement a Craps game, using a language that we have just |
|---|
| | 4 | learned. Also, it was written in a functional style with almost no reliance on the assignment |
|---|
| | 5 | operation. Only one local variable called THROW was used. |
|---|
| | 6 | """ |
|---|
| 5 | 7 | ;;; ====================================================================================================== ;;; |
|---|
| 6 | 8 | ;;; ======================================= CRAPS SIMULATION ============================================= ;;; |
|---|
| rb4f9575 |
r3695ff8 |
|
| 1 | 1 | ;;; CrapsSim.lsp |
|---|
| 2 | 2 | |
|---|
| 3 | | ;;; The main purpose of this program was to implement a Craps game, using a language that we have just |
|---|
| 4 | | ;;; learned. Also, it was written in a functional style with almost no reliance on the assignment |
|---|
| 5 | | ;;; operation. Only one local variable called THROW was used. |
|---|
| | 3 | """ |
|---|
| | 4 | The main purpose of this program was to implement a Craps game, using a language that we have just |
|---|
| | 5 | learned. Also, it was written in a functional style with almost no reliance on the assignment |
|---|
| | 6 | operation. Only one local variable called THROW was used. |
|---|
| | 7 | """ |
|---|
| 6 | 8 | |
|---|
| 7 | 9 | |
|---|
| r101d05d |
r3695ff8 |
|
| 8 | 8 | end |
|---|
| 9 | 9 | |
|---|
| | 10 | def test_doc_string |
|---|
| | 11 | lb = [Ohcount::LanguageBreakdown.new("lisp", "", '""" comment """', 0)] |
|---|
| | 12 | assert_equal lb, Ohcount::parse(' """ comment """', "lisp") |
|---|
| | 13 | end |
|---|
| | 14 | |
|---|
| | 15 | def test_doc_string_blank |
|---|
| | 16 | lb = [Ohcount::LanguageBreakdown.new("lisp", "", '""""""', 0)] |
|---|
| | 17 | assert_equal lb, Ohcount::parse(' """"""', "lisp") |
|---|
| | 18 | end |
|---|
| | 19 | |
|---|
| 10 | 20 | def test_comprehensive |
|---|
| 11 | 21 | verify_parse("lsp1.lsp") |
|---|