Skip to content

Commit 4b45f05

Browse files
committed
[SwiftSyntax] Move error function to standalone Utils.py
1 parent 341bc34 commit 4b45f05

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

utils/gyb_syntax_support/Classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .Node import error
1+
from .Utils import error
22
from .kinds import lowercase_first_word # noqa: I201
33

44

utils/gyb_syntax_support/Node.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
import sys # noqa: I201
2-
1+
from .Utils import error
32
from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
43

54

6-
def error(msg):
7-
print('error: ' + msg, file=sys.stderr)
8-
sys.exit(-1)
9-
10-
115
class Node(object):
126
"""
137
A Syntax node, possibly with children.

utils/gyb_syntax_support/NodeSerializationCodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .Node import error
1+
from .Utils import error
22

33

44
SYNTAX_NODE_SERIALIZATION_CODES = {

utils/gyb_syntax_support/Token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .Classification import classification_by_name
2-
from .Node import error # noqa: I201
2+
from .Utils import error # noqa: I201
33
from .kinds import lowercase_first_word # noqa: I201
44

55

utils/gyb_syntax_support/Trivia.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .Node import error
1+
from .Utils import error
22
from .kinds import lowercase_first_word # noqa: I201
33

44

utils/gyb_syntax_support/Utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys
2+
3+
4+
def error(msg):
5+
print('error: ' + msg, file=sys.stderr)
6+
sys.exit(-1)

0 commit comments

Comments
 (0)