Wiki

Ticket #218 (closed defect: fixed)

Opened 14 years ago

Last modified 12 years ago

Doc comments work in two variants, not in third.

Reported by: nevdelap Owned by: Chuck
Priority: minor Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

class Program

    def main
        pass

    def m1
        """
        This doc comment is fine.
        """
        pass

    def m2
        """ This is doc comment is also fine. """
        pass

    def m3
        """ This one causes
            it indigestion. """
        pass

test.cobra(17): error: Expecting EOL, but got """ (DOUBLE_QUOTE) instead.

If you don't want the third type then consider this bug a report on the error message, that it could say what the problem is with this format of doc comment.

And that it calls a triple quote a double quote (or maybe it's just referring to the first of the three double quotes?) is a bit odd too.

Attachments

bad-docString.patch Download (3.5 KB) - added by hopscc 14 years ago.
docStr-fix.patch Download (1.3 KB) - added by hopscc 12 years ago.

Change History

Changed 14 years ago by hopscc

Its not recognising the construct as a docString ( or anything else) and because of what it is expecting its reporting on the token one behind the one where it failed recognition.

Changed 14 years ago by hopscc

Changed 14 years ago by hopscc

  • status changed from new to assigned
  • owner set to Chuck

Heres a patch for trapping this and emitting a better error message.

Changed 13 years ago by Charles

  • status changed from assigned to closed
  • resolution set to fixed

Patch applied in changeset:2718

I'm not sure why test case 406 doesn't also get the informative error message. Was that intentional?

Changed 12 years ago by hopscc

Changed 12 years ago by hopscc

Was missing a check and fix for test case 406.
In second patch.

Changed 12 years ago by Charles

  • status changed from closed to reopened
  • resolution fixed deleted

Don't forget to re-open the ticket. I almost missed this as I usually don't look at closed tickets.

Changed 12 years ago by Charles

  • status changed from reopened to closed
  • resolution set to fixed

2nd patch applied in changeset:2749

Note: See TracTickets for help on using tickets.