prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug in reader: can't terminate string literals containing \ at end of line.
  Common Lisp had docstrings before Python existed. Hy should totally support this.
  
  ``` Python
  >>> def foo():
      """I'm a docstring!"""
      return 42
  
  >>> help(foo)
  Help on function foo in module __main__:
  
  foo()
      I'm a docstring!
  
  >>> foo.__doc__
  "I'm a docstring!"
  ```
  
  Let's try it in Hy.
  
  ```
  => (defn foo ()
  ... """I'm a docstring"""
  ... 42)
  => (help foo)
  Help on function foo:
  
  foo()
  
  => foo.__doc__
  ''
  ```
  
  ?!
  Where's my docstring?
  (some time later...)
  Let's try hy2py.
  
  ``` Python
  def foo():
      ''
      "I'm a docstring!"
      ''
      return 42
  ```
  
  I see what you did there, Hy. Yeah, there should probably be a warning about that somewhere. Triple  quotes don't work. Why does Python use them anyway? So we can include newlines mostly. Common Lisp strings do that already. Does Hy?
  
  ```
  => "one
  ... two"
  'one\ntwo
  ```
  
  Yup. Looks good.
  Escapes also appear to work. But what if I actually wanted backslashes? Do raw strings work?
  
  ```
  => r"\foo"
  '\\foo
  ```
  
  Nice. Now **raw** triple quoted strings? This works in Python:
  
  ``` Python
  >>> r"""\
  foo"""
  '\\\nfoo'
  ```
  
  Let's use what we've learned and try it in Hy.
  
  ```
  => r"\
  ... foo"
  ... "
  ... ""
  ... """
  ... what?
  ... \
  ... \
  ... \\
  ... \\\
  ... \\\\
  ... \"
  ... \\"
  ... \\\"
  ... \\\\"
  ...   C-c C-c
  
  KeyboardInterrupt
  ```
  
  Something is broken...
  
  
  </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('HLCURLY', r'#\{')
  39 lg.add('QUOTE', r'\'%s' % end_quote)
  40 lg.add('QUASIQUOTE', r'`%s' % end_quote)
  41 lg.add('UNQUOTESPLICE', r'~@%s' % end_quote)
  42 lg.add('UNQUOTE', r'~%s' % end_quote)
  43 lg.add('HASHBANG', r'#!.*[^\r\n]')
  44 lg.add('HASHREADER', r'#[^{]')
  45 
  46 # A regexp which matches incomplete strings, used to support
  47 # multi-line strings in the interpreter
  48 partial_string = r'''(?x)
  49     (?:u|r|ur|ru)? # prefix
  50     "  # start string
  51     (?:
  52        | [^"\\]             # non-quote or backslash
  53        | \\.                # or escaped single character
  54        | \\x[0-9a-fA-F]{2}  # or escaped raw character
  55        | \\u[0-9a-fA-F]{4}  # or unicode escape
  56        | \\U[0-9a-fA-F]{8}  # or long unicode escape
  57     )* # one or more times
  58 '''
  59 
  60 lg.add('STRING', r'%s"' % partial_string)
  61 lg.add('PARTIAL_STRING', partial_string)
  62 
  63 lg.add('IDENTIFIER', r'[^()\[\]{}\'"\s;]+')
  64 
  65 
  66 lg.ignore(r';.*(?=\r|\n|$)')
  67 lg.ignore(r'\s+')
  68 
  69 
  70 lexer = lg.build()
  71
  [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
  @@ -50,7 +50,7 @@
       "  # start string
       (?:
          | [^"\\]             # non-quote or backslash
  -       | \\.                # or escaped single character
  +       | \\(.|\n)           # or escaped single character or newline
          | \\x[0-9a-fA-F]{2}  # or escaped raw character
          | \\u[0-9a-fA-F]{4}  # or unicode escape
          | \\U[0-9a-fA-F]{8}  # or long unicode escape
  
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@@ -50,7 +50,7 @@\n     \"  # start string\n     (?:\n        | [^\"\\\\]             # non-quote or backslash\n-       | \\\\.                # or escaped single character\n+       | \\\\(.|\\n)           # or escaped single character or newline\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", "issue": "Bug in reader: can't terminate string literals containing \\ at end of line.\nCommon Lisp had docstrings before Python existed. Hy should totally support this.\n\n``` Python\n>>> def foo():\n    \"\"\"I'm a docstring!\"\"\"\n    return 42\n\n>>> help(foo)\nHelp on function foo in module __main__:\n\nfoo()\n    I'm a docstring!\n\n>>> foo.__doc__\n\"I'm a docstring!\"\n```\n\nLet's try it in Hy.\n\n```\n=> (defn foo ()\n... \"\"\"I'm a docstring\"\"\"\n... 42)\n=> (help foo)\nHelp on function foo:\n\nfoo()\n\n=> foo.__doc__\n''\n```\n\n?!\nWhere's my docstring?\n(some time later...)\nLet's try hy2py.\n\n``` Python\ndef foo():\n    ''\n    \"I'm a docstring!\"\n    ''\n    return 42\n```\n\nI see what you did there, Hy. Yeah, there should probably be a warning about that somewhere. Triple  quotes don't work. Why does Python use them anyway? So we can include newlines mostly. Common Lisp strings do that already. Does Hy?\n\n```\n=> \"one\n... two\"\n'one\\ntwo\n```\n\nYup. Looks good.\nEscapes also appear to work. But what if I actually wanted backslashes? Do raw strings work?\n\n```\n=> r\"\\foo\"\n'\\\\foo\n```\n\nNice. Now **raw** triple quoted strings? This works in Python:\n\n``` Python\n>>> r\"\"\"\\\nfoo\"\"\"\n'\\\\\\nfoo'\n```\n\nLet's use what we've learned and try it in Hy.\n\n```\n=> r\"\\\n... foo\"\n... \"\n... \"\"\n... \"\"\"\n... what?\n... \\\n... \\\n... \\\\\n... \\\\\\\n... \\\\\\\\\n... \\\"\n... \\\\\"\n... \\\\\\\"\n... \\\\\\\\\"\n...   C-c C-c\n\nKeyboardInterrupt\n```\n\nSomething is broken...\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('HLCURLY', 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# A regexp which matches incomplete strings, used to support\n# multi-line strings in the interpreter\npartial_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'''\n\nlg.add('STRING', r'%s\"' % partial_string)\nlg.add('PARTIAL_STRING', partial_string)\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"}]}