prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  problem with comment parsing
  I was translating some code to Hy from a textbook on Python programming (http://inventwithpython.com/pygame/index.html) and ran into a problem with this direct translation.
  
  ```
  (import pygame sys)
  (import [pygame.locals [*]])
  
  (pygame.init)
  (setv *displaysurf* (pygame.display.set_mode (, 400 300)))
  (pygame.display.set_caption "Hello World!")
  (while True ; main game loop
         (do (foreach [event (pygame.event.get)]
                      (if (= event.type QUIT)
                          (do (pygame.quit)
                              (sys.exit))))
             (pygame.display.update)))
  ```
  
  I get a parse error if the end-of-line comment ("main game loop") appears where it does.  It works if I remove it.
  
  The following interaction with the prompt also surprised me.
  
  ```
  => ; some comment
  hy.lex.exceptions.LexException: Could not identify the next token at line -1, column -1
  ```
  
  Fixing this isn't critical, but it should probably be fixed.  I do occasionally type something, realize I need to do something else first, comment it, press Enter, type whatever setup I needed, press Enter, then press Up twice, uncomment the line, and Enter to run it.
  
  problem with comment parsing
  I was translating some code to Hy from a textbook on Python programming (http://inventwithpython.com/pygame/index.html) and ran into a problem with this direct translation.
  
  ```
  (import pygame sys)
  (import [pygame.locals [*]])
  
  (pygame.init)
  (setv *displaysurf* (pygame.display.set_mode (, 400 300)))
  (pygame.display.set_caption "Hello World!")
  (while True ; main game loop
         (do (foreach [event (pygame.event.get)]
                      (if (= event.type QUIT)
                          (do (pygame.quit)
                              (sys.exit))))
             (pygame.display.update)))
  ```
  
  I get a parse error if the end-of-line comment ("main game loop") appears where it does.  It works if I remove it.
  
  The following interaction with the prompt also surprised me.
  
  ```
  => ; some comment
  hy.lex.exceptions.LexException: Could not identify the next token at line -1, column -1
  ```
  
  Fixing this isn't critical, but it should probably be fixed.  I do occasionally type something, realize I need to do something else first, comment it, press Enter, type whatever setup I needed, press Enter, then press Up twice, uncomment the line, and Enter to run it.
  
  
  </issue>
  <code>
  [start of hy/lex/lexer.py]
  1 # Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>
  2 #
  3 # Permission is hereby granted, free of charge, to any person obtaining a
  4 # copy of this software and associated documentation files (the "Software"),
  5 # to deal in the Software without restriction, including without limitation
  6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  7 # and/or sell copies of the Software, and to permit persons to whom the
  8 # Software is furnished to do so, subject to the following conditions:
  9 #
  10 # The above copyright notice and this permission notice shall be included in
  11 # all copies or substantial portions of the Software.
  12 #
  13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  16 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19 # DEALINGS IN THE SOFTWARE.
  20 
  21 from rply import LexerGenerator
  22 
  23 
  24 lg = LexerGenerator()
  25 
  26 
  27 # A regexp for something that should end a quoting/unquoting operator
  28 # i.e. a space or a closing brace/paren/curly
  29 end_quote = r'(?![\s\)\]\}])'
  30 
  31 
  32 lg.add('LPAREN', r'\(')
  33 lg.add('RPAREN', r'\)')
  34 lg.add('LBRACKET', r'\[')
  35 lg.add('RBRACKET', r'\]')
  36 lg.add('LCURLY', r'\{')
  37 lg.add('RCURLY', r'\}')
  38 lg.add('QUOTE', r'\'%s' % end_quote)
  39 lg.add('QUASIQUOTE', r'`%s' % end_quote)
  40 lg.add('UNQUOTESPLICE', r'~@%s' % end_quote)
  41 lg.add('UNQUOTE', r'~%s' % end_quote)
  42 lg.add('HASHBANG', r'#!.*[^\r\n]')
  43 lg.add('HASHREADER', r'#.')
  44 
  45 
  46 lg.add('STRING', r'''(?x)
  47     (?:u|r|ur|ru)? # prefix
  48     "  # start string
  49     (?:
  50        | [^"\\]             # non-quote or backslash
  51        | \\.                # or escaped single character
  52        | \\x[0-9a-fA-F]{2}  # or escaped raw character
  53        | \\u[0-9a-fA-F]{4}  # or unicode escape
  54        | \\U[0-9a-fA-F]{8}  # or long unicode escape
  55     )* # one or more times
  56     "  # end string
  57 ''')
  58 
  59 
  60 lg.add('IDENTIFIER', r'[^()\[\]{}\'"\s;]+')
  61 
  62 
  63 lg.ignore(r';.*[\r\n]+')
  64 lg.ignore(r'\s+')
  65 
  66 
  67 lexer = lg.build()
  68
  [end of hy/lex/lexer.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/hy/lex/lexer.py b/hy/lex/lexer.py
  --- a/hy/lex/lexer.py
  +++ b/hy/lex/lexer.py
  @@ -60,7 +60,7 @@
   lg.add('IDENTIFIER', r'[^()\[\]{}\'"\s;]+')
   
   
  -lg.ignore(r';.*[\r\n]+')
  +lg.ignore(r';.*(?=\r|\n|$)')
   lg.ignore(r'\s+')
  
verification_info: {"golden_diff": "diff --git a/hy/lex/lexer.py b/hy/lex/lexer.py\n--- a/hy/lex/lexer.py\n+++ b/hy/lex/lexer.py\n@@ -60,7 +60,7 @@\n lg.add('IDENTIFIER', r'[^()\\[\\]{}\\'\"\\s;]+')\n \n \n-lg.ignore(r';.*[\\r\\n]+')\n+lg.ignore(r';.*(?=\\r|\\n|$)')\n lg.ignore(r'\\s+')\n", "issue": "problem with comment parsing\nI was translating some code to Hy from a textbook on Python programming (http://inventwithpython.com/pygame/index.html) and ran into a problem with this direct translation.\n\n```\n(import pygame sys)\n(import [pygame.locals [*]])\n\n(pygame.init)\n(setv *displaysurf* (pygame.display.set_mode (, 400 300)))\n(pygame.display.set_caption \"Hello World!\")\n(while True ; main game loop\n       (do (foreach [event (pygame.event.get)]\n                    (if (= event.type QUIT)\n                        (do (pygame.quit)\n                            (sys.exit))))\n           (pygame.display.update)))\n```\n\nI get a parse error if the end-of-line comment (\"main game loop\") appears where it does.  It works if I remove it.\n\nThe following interaction with the prompt also surprised me.\n\n```\n=> ; some comment\nhy.lex.exceptions.LexException: Could not identify the next token at line -1, column -1\n```\n\nFixing this isn't critical, but it should probably be fixed.  I do occasionally type something, realize I need to do something else first, comment it, press Enter, type whatever setup I needed, press Enter, then press Up twice, uncomment the line, and Enter to run it.\n\nproblem with comment parsing\nI was translating some code to Hy from a textbook on Python programming (http://inventwithpython.com/pygame/index.html) and ran into a problem with this direct translation.\n\n```\n(import pygame sys)\n(import [pygame.locals [*]])\n\n(pygame.init)\n(setv *displaysurf* (pygame.display.set_mode (, 400 300)))\n(pygame.display.set_caption \"Hello World!\")\n(while True ; main game loop\n       (do (foreach [event (pygame.event.get)]\n                    (if (= event.type QUIT)\n                        (do (pygame.quit)\n                            (sys.exit))))\n           (pygame.display.update)))\n```\n\nI get a parse error if the end-of-line comment (\"main game loop\") appears where it does.  It works if I remove it.\n\nThe following interaction with the prompt also surprised me.\n\n```\n=> ; some comment\nhy.lex.exceptions.LexException: Could not identify the next token at line -1, column -1\n```\n\nFixing this isn't critical, but it should probably be fixed.  I do occasionally type something, realize I need to do something else first, comment it, press Enter, type whatever setup I needed, press Enter, then press Up twice, uncomment the line, and Enter to run it.\n\n", "before_files": [{"content": "# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n\nfrom rply import LexerGenerator\n\n\nlg = LexerGenerator()\n\n\n# A regexp for something that should end a quoting/unquoting operator\n# i.e. a space or a closing brace/paren/curly\nend_quote = r'(?![\\s\\)\\]\\}])'\n\n\nlg.add('LPAREN', r'\\(')\nlg.add('RPAREN', r'\\)')\nlg.add('LBRACKET', r'\\[')\nlg.add('RBRACKET', r'\\]')\nlg.add('LCURLY', r'\\{')\nlg.add('RCURLY', r'\\}')\nlg.add('QUOTE', r'\\'%s' % end_quote)\nlg.add('QUASIQUOTE', r'`%s' % end_quote)\nlg.add('UNQUOTESPLICE', r'~@%s' % end_quote)\nlg.add('UNQUOTE', r'~%s' % end_quote)\nlg.add('HASHBANG', r'#!.*[^\\r\\n]')\nlg.add('HASHREADER', r'#.')\n\n\nlg.add('STRING', r'''(?x)\n    (?:u|r|ur|ru)? # prefix\n    \"  # start string\n    (?:\n       | [^\"\\\\]             # non-quote or backslash\n       | \\\\.                # or escaped single character\n       | \\\\x[0-9a-fA-F]{2}  # or escaped raw character\n       | \\\\u[0-9a-fA-F]{4}  # or unicode escape\n       | \\\\U[0-9a-fA-F]{8}  # or long unicode escape\n    )* # one or more times\n    \"  # end string\n''')\n\n\nlg.add('IDENTIFIER', r'[^()\\[\\]{}\\'\"\\s;]+')\n\n\nlg.ignore(r';.*[\\r\\n]+')\nlg.ignore(r'\\s+')\n\n\nlexer = lg.build()\n", "path": "hy/lex/lexer.py"}]}