summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-08 16:27:55 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-08 16:29:16 +0200
commitbfdfbb2148a1c4ec2e0bf9c3eb4cd78ee79d91e3 (patch)
treeddb605f1294b033d2d166afd9534e65099f2c750
parent43fba1c1e2938b5160df5dd973f168504826facf (diff)
Remove unused prolog.util.normalized
-rw-r--r--monkey/edits.py2
-rw-r--r--prolog/util.py11
2 files changed, 1 insertions, 12 deletions
diff --git a/monkey/edits.py b/monkey/edits.py
index 56bf773..0f3a3e4 100644
--- a/monkey/edits.py
+++ b/monkey/edits.py
@@ -18,7 +18,7 @@ import collections
import math
from .action import expand, parse
-from prolog.util import normalized, parse as prolog_parse, rename_vars_ast, rename_vars_list, interesting_ranges, stringify, tokenize
+from prolog.util import parse as prolog_parse, rename_vars_ast, rename_vars_list, interesting_ranges, stringify, tokenize
from .util import avg, logistic
def get_edits_from_trace(trace, test, id):
diff --git a/prolog/util.py b/prolog/util.py
index 644080d..e682edb 100644
--- a/prolog/util.py
+++ b/prolog/util.py
@@ -155,17 +155,6 @@ def interesting_ranges(ast, path=()):
if isinstance(subtree, Tree):
yield from interesting_ranges(subtree, path + (ast.label(),))
-# Helper function to remove trailing punctuation from lines and rename
-# variables to A1,A2,A3,… (potentially using [var_names]). Return a tuple.
-def normalized(line, var_names=None):
- # Remove trailing punctuation.
- i = len(line)
- while i > 0:
- if line[i-1].type not in ('COMMA', 'PERIOD', 'SEMI'):
- break
- i -= 1
- return tuple(rename_vars(line[:i], var_names))
-
# Map "formal" variable names in the edit a→b to actual names in code [tokens].
# The set [variables] contains all variable names in the current scope. These
# are used in cases such as [A]→[A,B], where the edit introduces new variables.