Exemplo n.º 1
0
def testPythonMacro(theInput):
	return polishNotation2.testMacro(theInput, pythonSyntaxArray)
Exemplo n.º 2
0
#This is the main file for all of my macro language projects.

#The syntax rules for these macros are defined within syntaxRules.py in the 'libraries' folder.

#An experimental programming language translator is defined in polyglotCodeGenerator.py

#Use Pillow to generate images: http://www.pythonforbeginners.com/modules-in-python/how-to-use-pillow/

loopCondition = '5/4'

'''
def "recursively sort the array <<foo>>"
	
'''

'''
polishNotation2.testMacro("(1) to the power of (2)")
polishNotation2.testMacro("the square root of (4)")
polishNotation2.testMacro("5.4 rounded up")
polishNotation2.testMacro("5.4 rounded down")
polishNotation2.testMacro("5 / 4")
polishNotation2.testMacro("split the string 'Hello world' with the separator 'o'")
polishNotation2.testMacro("'Hello' contains 'o'")
polishNotation2.testMacro("The string 'derp' matches the regex ('(h|d)erp')")
polishNotation2.testMacro("all occurrences of 'oo' in the string 'oh woohoo hoo'")
polishNotation2.testMacro("all indices of 'hi' in the array (split the string 'hiohioohio' with the separator 'o')")
polishNotation2.testMacro("split the string 'hiohioohio' with the separator 'o'")
polishNotation2.testMacro("the dimensions of [[1,2],[3,4]]")
polishNotation2.testMacro("the regular expression 'h(o|i)' matches the string 'hi'")
polishNotation2.testMacro("insert 'hi' after the index 1 inside the array [1,2,3]")
polishNotation2.testMacro("insert 'hi' before the index 1 in the array [1,2,3]")