simplepy 1.2.2 copy "simplepy: ^1.2.2" to clipboard
simplepy: ^1.2.2 copied to clipboard

An interpreter for a subset of the Python language, written purely in Dart. It is intended for adding scripting capabilities to Dart projects and for educational purposes.

example/simplepy_example.dart

import 'package:simplepy/simplepy.dart';

void main() {
  String py = """
def fibo(n):
  if n<=2:
    return 1
  return fibo(n-1) + fibo(n-2)

print(fibo(20))
""";
  final tokens = Lexer(py).scanTokens();
  final stmts = Parser(tokens).parse();
  Interpreter().interpret(stmts);
}
0
likes
0
points
253
downloads

Publisher

unverified uploader

Weekly Downloads

An interpreter for a subset of the Python language, written purely in Dart. It is intended for adding scripting capabilities to Dart projects and for educational purposes.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on simplepy