Changeset 1761

Show
Ignore:
Timestamp:
11/12/08 04:10:32 (8 weeks ago)
Author:
Chuck.Esterbrook
Message:

Add support for one-line doc strings.
ticket:43
credit:hopscc,Chuck

Location:
cobra/trunk
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Developer/IntermediateReleaseNotes.text

    r1746 r1761  
    11Post 0.8 
     2 
     3* Support one line docstrings 
     4.code 
     5    """ This is a one line docStr""" 
    26 
    37* Added storage type specification for enums: 
  • cobra/trunk/Source/CobraParser.cobra

    r1744 r1761  
    417417                        text = Utils.join('', textParts) 
    418418                        return text 
     419                else if .optional('DOC_STRING_LINE') 
     420                        return .last.value to String 
    419421                else 
    420422                        return '' 
  • cobra/trunk/Source/CobraTokenizer.cobra

    r1736 r1761  
    120120                        # doc strings 
    121121                        r'DOC_STRING_START              """[ \t]*\n', 
     122                        r'DOC_STRING_LINE               """.*"""[ \t]*\n', 
    122123 
    123124                        # sharp strings 
     
    781782                return tok 
    782783 
     784        def onDOC_STRING_LINE(tok as IToken) as IToken 
     785                tok.value = tok.text.trim[3:-3].trim 
     786                return tok 
    783787 
    784788        ##