Пример #1
0
def testMacro(syntaxRules, theInput):
    
    syntaxRules = makeSyntaxRules(syntaxRules)
    pythonSyntaxArray = polishNotation2.makeReallyNewInfoArray(syntaxRules, "Python")
    return polishNotation2.testMacro(theInput, pythonSyntaxArray)
import syntaxRules
from grammar import grammar
from EngScript import outputString
import polyglotCodeGenerator
import polishNotation2
EngScriptException = polyglotCodeGenerator.EngScriptException

theSyntaxRules = syntaxRules.makeSyntaxRules(grammar)
theSyntaxRules = polishNotation2.makeReallyNewInfoArray(theSyntaxRules, "Python")

listOfLanguages = "PHP,Tcl,Lua,ML,PHP,Racket,Common Lisp,Clojure,Hack,Swift,Prolog,AWK,Ruby,Java,Scala,Julia,JavaScript,Perl,Lua,Haxe,Erlang,Python,R,Vala,Delphi,Gosu,AutoHotKey,Groovy,Common Lisp,Dart,F#,Swift,Pike,C,C++,Nemerle,Oz,AutoIt,ML,Haskell,Julia,C#,REBOL,Go,Visual Basic,PHP,Kotlin"

listOfLanguages = "Swift,PHP,C#,Scala"

listOfLanguages = "REBOL,CoffeeScript,TypeScript,Tcl,J,F#,Visual Basic,Clojure,Racket,Haxe,Erlang,Python,AutoHotKey,C#,Java,PHP,Lua,Swift,Scala,Nemerle,Perl,AutoIt,Ruby,Common Lisp,Julia"

listOfLanguages = "Racket,LispyScript,Sibilant,Nimrod,Lua,Perl,Visual Basic,AutoIt"

listOfLanguages = "Rust,Racket,Clojure,Common Lisp"

listOfLanguages = "Puppet,PowerShell,C#,Gambas,Java,Python,C,Lua,PHP,Dart,CoffeeScript,Haxe,Hack,Ruby,Clojure,Perl,Visual Basic,Common Lisp,Nemerle,Scala,Go,AutoIt,Vala,Swift,R,Rust,Groovy,AutoHotkey,Gosu,REBOL,Julia,AWK,F#,OCaml"

#listOfLanguages = "C#,Java,Ruby,JavaScript"

#listOfLanguages = "Hy,OCaml"

listOfLanguages = listOfLanguages.split(",")



#listOfLanguages = "Ruby,Lua,PHP,TypeScript,CoffeeScript,Python,C#,Java".split(",")
Пример #3
0
def testMacro(syntaxRules, theInput):

    syntaxRules = makeSyntaxRules(syntaxRules)
    pythonSyntaxArray = polishNotation2.makeReallyNewInfoArray(
        syntaxRules, "Python")
    return polishNotation2.testMacro(theInput, pythonSyntaxArray)