ursalang / ursa

A friendly, stable general-purpose programming language
https://ursalang.github.io
3 stars 1 forks source link

Add Pythonic syntax #74

Open rrthomas opened 1 week ago

rrthomas commented 1 week ago

See https://github.com/sakekasi/python-in-ohm/ for how to do this sort of syntax in Ohm: basically, pre-parse the indents and turn them into otherwise invalid characters such as ⇒ and ⇐ to represent indent and dedent. Then parse these in the normal way.

Rename the two Ursa syntaxes indent and brace (with aliases python and c). If no explicit syntax is given on the command line, parse as brace first and then try as indent if that fails. Same in the REPL.