forked from lottie/lottie-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tools to generate (pseudo)code * Algorithm block processor * Script to test shape code * Improved pseudocode * Clarify wording about provided algorithms * Flexible coding style
- Loading branch information
Showing
7 changed files
with
544 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from source_translator import SourceCode | ||
from source_translator.langs import cpp, ts | ||
from . import pseudocode | ||
|
||
|
||
language_names = { | ||
"pseudo": "Pseudo-Code", | ||
"py": "Python", | ||
"cpp": "C++", | ||
"ts": "TypeScript", | ||
} | ||
|
||
|
||
def code_to_samples(source): | ||
data = SourceCode(source) | ||
return { | ||
"ast": data.ast, | ||
"pseudo": pseudocode.PseudoCode().convert(data), | ||
"py": source, | ||
"cpp": cpp.CppTranslator().convert(data), | ||
"ts": ts.TypeScriptTranslator().convert(data), | ||
} |
Oops, something went wrong.