Skip to content

Commit

Permalink
return SourcePosition to WDL.Error
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Jan 29, 2022
1 parent b0f67b1 commit 8b83094
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
35 changes: 33 additions & 2 deletions WDL/Error.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
# pyre-strict
from typing import List, Optional, Union, Iterable, TypeVar, Generator, Callable, Any, Dict
from typing import (
List,
Optional,
Union,
Iterable,
TypeVar,
Generator,
Callable,
Any,
Dict,
NamedTuple,
)
from functools import total_ordering
from contextlib import contextmanager

from ._error_util import SourcePosition
from . import Type


class SourcePosition(
NamedTuple(
"SourcePosition",
[
("uri", str),
("abspath", str),
("line", int),
("column", int),
("end_line", int),
("end_column", int),
],
)
):
"""
Source position attached to AST nodes and exceptions; NamedTuple of ``uri`` the filename/URI
passed to :func:`WDL.load` or a WDL import statement, which may be relative; ``abspath`` the
absolute filename/URI; and one-based int positions ``line`` ``end_line`` ``column``
``end_column``
"""


class SyntaxError(Exception):
"""Failure to lex/parse a WDL document"""

Expand Down
22 changes: 0 additions & 22 deletions WDL/_error_util.py

This file was deleted.

0 comments on commit 8b83094

Please sign in to comment.