summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-04-24 21:15:54 -0600
committerkotfu <kotfu@kotfu.net>2018-04-24 21:15:54 -0600
commit8297d4d1c0a4f56c6c952059fb7fc2b43b1050ed (patch)
tree8f44aa8cde8c30b02a14093e4a48d4417b2a87ef /cmd2/parsing.py
parent6c489908e3238082328e73b20aa683d31ef88741 (diff)
downloadcmd2-git-8297d4d1c0a4f56c6c952059fb7fc2b43b1050ed.tar.gz
Refactoring and code cleanup
- rename CommandParser to StatementParser - move tests from test_shlexparsing.py to test_parsing.py - standardize the output of the parse() method into a variable called statement.
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index ffeb8bbe..9204305b 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -1,6 +1,6 @@
#
# -*- coding: utf-8 -*-
-"""Command parsing classes for cmd2"""
+"""Statement parsing classes for cmd2"""
import re
import shlex
@@ -32,7 +32,7 @@ class Statement(str):
self.output = None
self.outputTo = None
-class CommandParser():
+class StatementParser():
"""Parse raw text into command components.
Shortcuts is a list of tuples with each tuple containing the shortcut and the expansion.
@@ -55,7 +55,7 @@ class CommandParser():
self.aliases = aliases
self.shortcuts = shortcuts
- def parseString(self, rawinput):
+ def parse(self, rawinput):
# strip C-style comments
# shlex will handle the python/shell style comments for us
def replacer(match):