Closed BeibinLi closed 1 year ago
A parameter is added. Default to False. When True, it will also detect single-line code.
For instance, data = """
hello, how are you.
You can run python main.py
python main.py
Or, you can write
1 + 1 == 2 print(3)
Formated stuff here and there
Otherwise, do source download.sh for it.
source download.sh
I would also want to extract variable x.
x
Is that ok? """
extract_code(data, detect_single_line_code=True)
We will get
[('UNKNOWN', 'python main.py'), ('python', '1 + 1 == 2\nprint(3)'), ('UNKNOWN', 'Formated stuff here\nand there'), ('UNKNOWN', 'source download.sh'), ('UNKNOWN', 'x')]
Move to the autogen
A parameter is added. Default to False. When True, it will also detect single-line code.
For instance, data = """
hello, how are you.
You can run
python main.py
Or, you can write
Otherwise, do
source download.sh
for it.I would also want to extract variable
x
.Is that ok? """
extract_code(data, detect_single_line_code=True)
We will get
Why are these changes needed?
Related issue number
Checks