Permalink
Browse files

Remove more unused variables.

Also disable some warnings about whitespace.
  • Loading branch information...
Andy Chu
Andy Chu committed Feb 2, 2018
1 parent 9376827 commit 3483cbca40a45959fc6a3d59fcaf75ec3535055a
Showing with 4 additions and 14 deletions.
  1. +2 −2 asdl/asdl_.py
  2. +0 −1 asdl/encode.py
  3. +0 −2 asdl/format.py
  4. +0 −4 asdl/gen_python.py
  5. +1 −1 core/builtin_test.py
  6. +0 −2 core/cmd_exec_test.py
  7. +0 −1 core/completion.py
  8. +1 −1 test/lint.sh
View
@@ -96,7 +96,7 @@ def __init__(self, module, app_types=None):
# Primitive types.
self.declared_types['string'] = StrType()
self.declared_types['int'] = IntType()
self.declared_types['int'] = IntType()
self.declared_types['bool'] = BoolType()
# Types with fields that need to be reflected on: Product and Constructor.
@@ -511,7 +511,7 @@ def _parse_type(self):
# Otherwise it's a sum. Look for ConstructorId
sumlist = [Constructor(self._match(TokenKind.ConstructorId),
self._parse_optional_fields())]
while self.cur_token.kind == TokenKind.Pipe:
while self.cur_token.kind == TokenKind.Pipe:
# More constructors
self._advance()
sumlist.append(Constructor(
View
@@ -37,7 +37,6 @@ def Write(self, chunk):
Return a block pointer/index.
"""
# Input should be padded
a = self.alignment
assert len(chunk) % self.alignment == 0
self.f.write(chunk)
View
@@ -297,7 +297,6 @@ def MakeTree(obj, abbrev_hook=None, omit_empty=True):
# These lines can be possibly COMBINED all into one. () can replace
# indentation?
out_node = _Obj(obj.__class__.__name__)
fields = out_node.fields
for field_name, desc in obj.ASDL_TYPE.GetFields():
out_val = MakeFieldSubtree(obj, field_name, desc, abbrev_hook,
@@ -518,7 +517,6 @@ def _TrySingleLineObj(node, f, max_chars):
f.write(node.node_type)
f.PopColor()
n = len(node.fields)
for name, val in node.fields:
f.write(' %s:' % name)
if not _TrySingleLine(val, f, max_chars):
View
@@ -44,10 +44,6 @@ def _GenClass(self, desc, name, super_name, depth, tag_num=None):
self.Emit(' ASDL_TYPE = TYPE_LOOKUP.ByTypeName(%r)' % name, depth)
self.Emit(' __slots__ = %s' % quoted_fields, depth)
# TODO:
# py_meta.MakeTypes and py_meta._MakeFieldDescriptors fill
# DESCRIPTOR_LOOKUP, which is used for pretty printing.
lookup = {}
self.Emit('', depth)
# TODO: leave out spids? Mark it as an attribute?
View
@@ -19,7 +19,7 @@ def testEchoLexer(self):
def testAppendParts(self):
# allow_escape is True by default, but False when the user passes -r.
CASES = [
CASES = [
(['Aa', 'b', ' a b'], 100, 'Aa b \\ a\\ b'),
(['a', 'b', 'c'], 3, 'a b c '),
]
View
@@ -11,7 +11,6 @@
import unittest
from core import builtin
from core import cmd_exec # module under test
from core.cmd_exec import *
from core.id_kind import Id
@@ -42,7 +41,6 @@ def InitExecutor(arena=None):
mem = state.Mem('', [], {}, None)
fd_state = process.FdState()
status_lines = None # not needed for what we're testing
builtins = builtin.BUILTIN_DEF
funcs = {}
comp_funcs = {}
exec_opts = state.ExecOpts(mem)
View
@@ -784,7 +784,6 @@ def Init(pool, builtins, mem, funcs, comp_lookup, status_out, ev):
if __name__ == '__main__':
from core import builtin
from core import state
status_lines = ui.MakeStatusLines()
mem = state.Mem('', [], {}, None)
View
@@ -102,7 +102,7 @@ flake8-all() {
# E265: Although I agree with this style, some comments don't start with '# '
# E111,E114: we use 2 space indents, not 4
local ignored='E125,E701,E241,E121,E111,E114,E128,E262,E226,E302,E265,E290,E202,E203,C901,E261'
local ignored='E125,E701,E241,E121,E111,E114,E128,E262,E226,E302,E265,E290,E202,E203,C901,E261,E301,W293,E402,E116,E741,W391,E127'
# trailing whitespace, line too long, blank lines
local ignored_for_now='W291,E501,E303'

0 comments on commit 3483cbc

Please sign in to comment.