Wiki

Ticket #218: docStr-fix.patch

File docStr-fix.patch, 1.3 KB (added by hopscc, 6 years ago)
  • Source/CobraParser.cobra

     
    298298                            quoteToken = tok 
    299299                        textParts.add(tok.text) 
    300300                    else 
     301                        for l in textParts 
     302                            if l.trim.endsWith('"""') 
     303                                msg='Triplequotes at the end of a line are not a valid end of docString. A docString has its terminating triplequotes alone on a single line.'                               
     304                                .throwError('Missing docString ending. [msg]')  
    301305                        .throwError('Expecting more doc string contents or the end of the doc string instead of [tok].') 
    302306            text = textParts.join('') 
    303307            return text 
  • Tests/820-errors/100-lexing-and-parsing/406-doc-string.cobra

     
     1# .error. Missing docString ending 
    12class Program 
    23 
    34    def main 
     
    89            This one also causes 
    910            it indigestion. """ 
    1011        pass 
    11 # .error. Expecting more doc string contents or the end of the doc string instead of "DEDENT".