source-academy / py-slang

Python sublanguage for SICP
Apache License 2.0
0 stars 0 forks source link

Parser broken? #41

Closed martin-henz closed 4 months ago

martin-henz commented 5 months ago

https://share.sourceacademy.org/kojls

def fact_iter(product, counter, max_count):
    if counter > max_count:
        return product
    else:
        return fact_iter(counter * product,counter + 1, max_count)

def factorial_iterative(n):
    return fact_iter(1, 1, n)

factorial_iterative(5)

gives:

Line 14: ExpectedTokenError: SyntaxError at line 14 column 9

def factorial_iterative(n):
         ^ Expected indent. Found 'return'.