Last change
on this file was 2, checked in by Yuri Dario, 15 years ago |
Initial import for vendor code.
|
-
Property svn:eol-style
set to
native
|
File size:
573 bytes
|
Line | |
---|
1 | # Copyright 2006 Google, Inc. All Rights Reserved.
|
---|
2 | # Licensed to PSF under a Contributor Agreement.
|
---|
3 |
|
---|
4 | """Fixer that turns <> into !=."""
|
---|
5 |
|
---|
6 | # Local imports
|
---|
7 | from .. import pytree
|
---|
8 | from ..pgen2 import token
|
---|
9 | from .. import fixer_base
|
---|
10 |
|
---|
11 |
|
---|
12 | class FixNe(fixer_base.BaseFix):
|
---|
13 | # This is so simple that we don't need the pattern compiler.
|
---|
14 |
|
---|
15 | _accept_type = token.NOTEQUAL
|
---|
16 |
|
---|
17 | def match(self, node):
|
---|
18 | # Override
|
---|
19 | return node.value == u"<>"
|
---|
20 |
|
---|
21 | def transform(self, node, results):
|
---|
22 | new = pytree.Leaf(token.NOTEQUAL, u"!=", prefix=node.prefix)
|
---|
23 | return new
|
---|
Note:
See
TracBrowser
for help on using the repository browser.