skulpt / skulpt

Skulpt is a Javascript implementation of the Python programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Editing skulpt to alter the python syntax

swickins opened this issue · comments

Possibly a very strange / ridiculous question, but how would one go about editing the skulpt library code so to alter the syntax of the python code?

The reason I ask is that in the UK, one of the main GCSE exam boards has its own fictitious 'language' which is incredibly similar to python with a few small changes.

For example, print("hello world") is exactly the same in both languages. However, a for loop in this 'exam' language is:

for i=0 to 7
print(“Hello”)
next i

What would I need to do to alter the skulpt code so that the syntax for the for loop above would be accepted (and the standard python syntax rejected)?

commented

I wouldn't try and edit the skulpt library to make that happen.

You'd probably want to write a python/javascript script to convert the pseudo code to python source code.
And then execute the converted source code using skulpt.

And it looks like someone might already done some of that work for you:
https://github.com/conductiveIT/OCR-Pseudocode-to-Python