diff options
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index e9957c62..75accb7f 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -48,8 +48,7 @@ from . import utils from . import plugin from .argparse_completer import AutoCompleter, ACArgumentParser, ACTION_ARG_CHOICES from .clipboard import can_clip, get_paste_buffer, write_to_paste_buffer -from .parsing import StatementParser, Statement, Macro, MacroArg, \ - macro_normal_arg_pattern, macro_escaped_arg_pattern, digit_pattern +from .parsing import StatementParser, Statement, Macro, MacroArg # Set up readline from .rl_utils import rl_type, RlType, rl_get_point, rl_set_prompt, vt100_support, rl_make_safe_prompt @@ -2409,7 +2408,7 @@ class Cmd(cmd.Cmd): # Find all normal arguments arg_list = [] - normal_matches = re.finditer(macro_normal_arg_pattern, value) + normal_matches = re.finditer(MacroArg.macro_normal_arg_pattern, value) max_arg_num = 0 num_set = set() @@ -2418,7 +2417,7 @@ class Cmd(cmd.Cmd): cur_match = normal_matches.__next__() # Get the number between the braces - cur_num = int(re.findall(digit_pattern, cur_match.group())[0]) + cur_num = int(re.findall(MacroArg.digit_pattern, cur_match.group())[0]) if cur_num < 1: self.perror("Argument numbers must be greater than 0", traceback_war=False) return @@ -2439,14 +2438,14 @@ class Cmd(cmd.Cmd): return # Find all escaped arguments - escaped_matches = re.finditer(macro_escaped_arg_pattern, value) + escaped_matches = re.finditer(MacroArg.macro_escaped_arg_pattern, value) while True: try: cur_match = escaped_matches.__next__() # Get the number between the braces - cur_num = int(re.findall(digit_pattern, cur_match.group())[0]) + cur_num = int(re.findall(MacroArg.digit_pattern, cur_match.group())[0]) arg_list.append(MacroArg(start_index=cur_match.start(), number=cur_num, is_escaped=True)) except StopIteration: |