Add support for space as a delimiter for macros

This commit is contained in:
Akbar Rahman 2019-01-18 18:15:11 +00:00
parent 7c93978ad9
commit 7a7d631a15
Signed by: alvierahman90
GPG Key ID: 20609519444A1269
4 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
.hc hydrocarbon
.h hydrogen
.c carbon
.hc hydrocarbon
.h hydrogen
.c carbon
.o oxygen
:wink: 😉

View File

@ -119,7 +119,7 @@ def get_macros(input):
"""
# turn input into unvalidated list of macros
macros = [x.split('\t') for x in input.split('\n')]
macros = [re.split('[ \t]', x) for x in input.split('\n')]
# validate macros
for index, macro in enumerate(macros):

4
pymacro/test.sh Executable file
View File

@ -0,0 +1,4 @@
#/usr/bin/env sh
./pymacro -sm tests/test_macros_plural -m tests/test_macros_biology tests/test_input tests/test_actual_output
diff tests/test_actual_output tests/test_expected_output

View File

@ -1,5 +0,0 @@
.hc hydrocarbon
.h hydrogen
.c carbon
.o oxygen
:wink: 😉