From 30fbf57e4b72e3947c323d98aee7b2d44663e33c Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Fri, 12 Jun 2015 13:41:04 +0200 Subject: delay pathod parsing until needed This allows us to use different languages based on runtime env. --- libpathod/pathod_cmdline.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libpathod') diff --git a/libpathod/pathod_cmdline.py b/libpathod/pathod_cmdline.py index 68828aca..f1bb6982 100644 --- a/libpathod/pathod_cmdline.py +++ b/libpathod/pathod_cmdline.py @@ -208,17 +208,11 @@ def args_pathod(argv, stdout=sys.stdout, stderr=sys.stderr): if os.path.isfile(spec): data = open(spec).read() spec = data - try: - req = language.parse_pathod(spec) - except language.ParseException as v: - print >> stderr, "Error parsing anchor spec: %s" % v.msg - print >> stderr, v.marked() - sys.exit(1) try: arex = re.compile(patt) except re.error: return parser.error("Invalid regex in anchor: %s" % patt) - anchors.append((arex, req)) + anchors.append((arex, spec)) args.anchors = anchors return args -- cgit v1.2.3