Skip to content

Commit

Permalink
Added support for multiline function typing, class and etc anything.
Browse files Browse the repository at this point in the history
  • Loading branch information
Almas-Ali committed Jun 29, 2023
1 parent 1f08015 commit 4979def
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion radon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,28 @@

def shell():
print('Radon 0.0.1\nPress Ctrl+C to exit()')
brace_count = 0

while True:
try:
text = input('radon > ')
text = input('>>> ')
if text.strip() == "":
continue

if text.strip()[-1] == '{':
brace_count += 1
while True:
text += '\n' + input('... ')
if text.strip()[-1] == '{':
brace_count += 1
elif text.strip()[-1] == '}':
brace_count -= 1

if brace_count == 0:
break



result, error, should_exit = base_core.run('<stdin>', text)

if error:
Expand Down

0 comments on commit 4979def

Please sign in to comment.