1. 03 Ock, 2003 1 kayıt (commit)
  2. 31 Ara, 2002 1 kayıt (commit)
    • Jeremy Hylton's avatar
      SF patch [ 597919 ] compiler package and SET_LINENO · accb62b2
      Jeremy Hylton yazdı
      A variety of changes from Michael Hudson to get the compiler working
      with 2.3.  The primary change is the handling of SET_LINENO:
      
      # The set_lineno() function and the explicit emit() calls for
      # SET_LINENO below are only used to generate the line number table.
      # As of Python 2.3, the interpreter does not have a SET_LINENO
      # instruction.  pyassem treats SET_LINENO opcodes as a special case.
      
      A few other small changes:
       - Remove unused code from pycodegen and pyassem.
       - Fix error handling in parsermodule.  When PyParser_SimplerParseString()
         fails, it sets an exception with detailed info.  The parsermodule
         was clobbering that exception and replacing it was a generic
         "could not parse string" exception.  Keep the original exception.
      accb62b2
  3. 06 Haz, 2002 1 kayıt (commit)
  4. 19 Nis, 2002 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Fix com_arglist() and update grammar fragment. · 8d22b040
      Jeremy Hylton yazdı
      SF bug #522264 reported by Evelyn Mitchell.
      
      The code included a comment about "STAR STAR" which was translated
      into the code as the bogus attribute token.STARSTAR.  This name never
      caused an attribute error because it was never retrieved.  The code
      was based on an old version of the grammar that specified kwargs as
      two tokens ('*' '*').  I checked as far back as 2.1 and didn't find
      this production.
      
      The fix is simple, because token.DOUBLESTAR is the only token
      allowed.  Also update the grammar fragment in com_arglist().
      
      XXX I'll bet lots of other grammar fragments in comments are out of
      date, probably in this module and in compile.c.
      8d22b040
  5. 28 Şub, 2002 1 kayıt (commit)
  6. 21 Ara, 2001 1 kayıt (commit)
  7. 18 Eki, 2001 1 kayıt (commit)
  8. 17 Eki, 2001 1 kayıt (commit)
  9. 17 Eyl, 2001 2 kayıt (commit)
    • Jeremy Hylton's avatar
      API change: · 9dca3643
      Jeremy Hylton yazdı
      compile() becomes replacement for builtin compile()
      compileFile() generates a .pyc from a .py
      both are exported in __init__
      
      compiler.parse() gets optional second argument to specify compilation
      mode, e.g. single, eval, exec
      
      Add AbstractCompileMode as parent class and Module, Expression, and
      Interactive as concrete subclasses.  Each corresponds to a compilation
      mode.
      
      THe AbstractCompileMode instances in turn delegate to CodeGeneration
      subclasses specialized for their particular functions --
      ModuleCodeGenerator, ExpressionCodeGeneration,
      InteractiveCodeGenerator.
      9dca3643
    • Jeremy Hylton's avatar
      Last set of change to get regression tests to pass · 2e4cc7e0
      Jeremy Hylton yazdı
      Remove the only test in the syntax module.  It ends up that the
      transformer must handle this error case.
      
      In the transformer, check for a list compression in com_assign_list()
      by looking for a list_for node where a comma is expected.
      
      In pycodegen.compile() re-raise the SyntaxError rather than catching
      it and exiting
      2e4cc7e0
  10. 29 Agu, 2001 3 kayıt (commit)
  11. 27 Agu, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Add lookup_name() to optimize use of stack frames · 7e30c9bb
      Jeremy Hylton yazdı
      The use of com_node() introduces a lot of extra stack frames, enough
      to cause a stack overflow compiling test.test_parser with the standard
      interpreter recursionlimit.  The com_node() is a convenience function
      that hides the dispatch details, but comes at a very high cost.  It is
      more efficient to dispatch directly in the callers.  In these cases,
      use lookup_node() and call the dispatched node directly.
      
      Also handle yield_stmt in a way that will work with Python 2.1
      (suggested by Shane Hathaway)
      7e30c9bb
  12. 18 Agu, 2001 1 kayıt (commit)
  13. 11 Nis, 2001 1 kayıt (commit)
  14. 09 Nis, 2001 1 kayıt (commit)
  15. 06 Kas, 2000 2 kayıt (commit)
  16. 25 Eki, 2000 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Many changes. · 7cff7fe2
      Jeremy Hylton yazdı
      Reformatting -- long lines, "[ ]" -> "[]", a few indentation nits.
      
      Replace calls to Node function (which constructed ast nodes) with
      calls to actual constructors imported from ast module.
      
      Optimize com_node (most frequently used method) for the common case --
      the appropriate method is found in _dispatch.
      
      Fix com_augassign to use class object's rather than node names
      (rendered invalid by recent changes to ast)
      
      Remove expensive tests for sequence-ness in com_stmt and
      com_append_stmt. These tests should never fail; if they do, something
      is really broken and exception will be raised elsewhere.
      
      Fix com_stmt and com_append_stmt to use isinstance rather than
      testing's type slot of ast node (this slot disappeared with recent
      changes to ast).
      7cff7fe2
  17. 13 Eki, 2000 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Now supports entire Python 2.0 language and still supports Python · 9c048f9f
      Jeremy Hylton yazdı
      1.5.2.  The compiler generates code for the version of the interpreter
      it is run under.
      
      ast.py:
          Print and Printnl add dest attr for extended print
          new node AugAssign for augmented assignments
          new nodes ListComp, ListCompFor, and ListCompIf for list
              comprehensions
      
      pyassem.py:
          add work around for string-Unicode comparison raising UnicodeError
              on comparison of two objects in code object's const table
      
      pycodegen.py:
          define VERSION, the Python major version number
          get magic number using imp.get_magic() instead of hard coding
          implement list comprehensions, extended print, and augmented
              assignment; augmented assignment uses Delegator classes (see
              doc string)
          fix import and tuple unpacking for 1.5.2
      
      transformer.py:
          various changes to support new 2.0 grammar and old 1.5 grammar
          add debug_tree helper than converts and symbol and token numbers
          to their names
      9c048f9f
  18. 12 Eki, 2000 1 kayıt (commit)
  19. 20 Eyl, 2000 1 kayıt (commit)
  20. 01 Eyl, 2000 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Update magic number. · 20516086
      Jeremy Hylton yazdı
      Fix import support to work with import as variant of Python 2.0.  The
      grammar for import changed, requiring changes in transformer and code
      generator, even to handle compilation of imports with as.
      20516086
  21. 04 Agu, 2000 1 kayıt (commit)
  22. 03 Agu, 2000 1 kayıt (commit)
  23. 02 May, 2000 1 kayıt (commit)
    • Jeremy Hylton's avatar
      patches from Mark Hammond · be317e61
      Jeremy Hylton yazdı
      Attached is a set of diffs for the .py compiler that adds support
      for the new extended call syntax.
      
      compiler/ast.py:
      CallFunc node gets 2 new children to support extended call syntax -
      "star_args" (for "*args") and "dstar_args" (for "**args")
      
      compiler/pyassem.py
      It appear that self.lnotab is supposed to be responsible for
      tracking line numbers, but self.firstlineno was still hanging
      around.  Removed self.firstlineno completely.  NOTE - I didnt
      actually test that the generated code has the correct line numbers!!
      
      Stack depth tracking appeared a little broken - the checks never
      made it beyond the "self.patterns" check - thus, the custom methods
      were never called!  Fixed this.
      
      (XXX Jeremy notes: I think this code is still broken because it
      doesn't track stack effects across block bounaries.)
      
      Added support for the new extended call syntax opcodes for depth
      calculations.
      
      compiler/pycodegen.py
      
      Added support for the new extended call syntax opcodes.
      
      compiler/transformer.py
      
      Added support for the new extended call syntax.
      be317e61
  24. 16 Mar, 2000 1 kayıt (commit)
  25. 06 Mar, 2000 1 kayıt (commit)
  26. 16 Şub, 2000 1 kayıt (commit)
  27. 15 Şub, 2000 2 kayıt (commit)
  28. 14 Şub, 2000 1 kayıt (commit)
  29. 08 Şub, 2000 2 kayıt (commit)
  30. 04 Şub, 2000 1 kayıt (commit)