summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/constants.py2
-rw-r--r--cmd2/parsing.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd2/constants.py b/cmd2/constants.py
index b829000f..d3e8a125 100644
--- a/cmd2/constants.py
+++ b/cmd2/constants.py
@@ -15,3 +15,5 @@ REDIRECTION_TOKENS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT, REDIRECTION_APPEND]
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')
+
+LINE_FEED = '\n'
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index b220f1c4..aa913187 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -10,8 +10,6 @@ from typing import List, Tuple, Dict
from . import constants
from . import utils
-LINE_FEED = '\n'
-
class Statement(str):
"""String subclass with additional attributes to store the results of parsing.
@@ -272,8 +270,8 @@ class StatementParser:
# we have to do this before we tokenize because tokenizing
# destroys all unquoted whitespace in the input
terminator = None
- if line[-1:] == LINE_FEED:
- terminator = LINE_FEED
+ if line[-1:] == constants.LINE_FEED:
+ terminator = constants.LINE_FEED
command = None
args = None
@@ -301,7 +299,7 @@ class StatementParser:
break
if terminator:
- if terminator == LINE_FEED:
+ if terminator == constants.LINE_FEED:
terminator_pos = len(tokens)+1
# everything before the first terminator is the command and the args