Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Compiler Testing Support #47

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
665ae6b
compile to empty typescript files
alexisthedev May 27, 2022
9e70548
Add representation for typescript types and lowercase object type
alexisthedev May 31, 2022
b4e430b
delete dead code in Kotlin ClassDecleration visitor
alexisthedev Jun 3, 2022
cd0e2ff
remove dead kotlin translator code
alexisthedev Jun 10, 2022
bc05ef2
Add argument validation for typescript, must use decline-use-site-var…
alexisthedev Jun 10, 2022
0124585
Change typescript equality operators
alexisthedev Jul 20, 2022
1cd0535
Added most of typescript functionality. Changed generator so no defau…
alexisthedev Jul 21, 2022
93b0d26
Add file for typescript keywords
alexisthedev Jul 25, 2022
581c5c4
add typescript translator functionality
alexisthedev Jul 25, 2022
ffe9880
add regex for tsc errors
alexisthedev Jul 26, 2022
b2350ba
Fix regex for identifying TS errors
theosotr Jul 26, 2022
875ac18
added regex for compiler crashes
alexisthedev Jul 27, 2022
652bbed
add braces around binary operands
alexisthedev Jul 28, 2022
0cc8d64
style & code changes based on comments from typescript-translator PR#1
alexisthedev Jul 28, 2022
dd9cc56
Fix some minor stylish issues
theosotr Jul 28, 2022
6cd52e1
Add arrow functions for nested functions in methods, update .gitignore
alexisthedev Jul 28, 2022
7b2f22d
Modify compiler to filter out error patterns and add reserved words
alexisthedev Jul 28, 2022
2f8c31e
Add null type and support in typescript + kotlin. Add undefined type …
alexisthedev Jul 29, 2022
f48061d
Change supertypes of NullType in typescript and kotlin, change supert…
alexisthedev Aug 9, 2022
9271b16
Correct the primitive status of typescript built-in types
alexisthedev Aug 16, 2022
ee4ddca
Change NullType and UndefinedType to primitives
alexisthedev Aug 16, 2022
e752905
change primitive status for typescript types
alexisthedev Aug 24, 2022
81a677a
(WIP) Add AST Nodes for type alias decls and begin adapting generator
alexisthedev Aug 24, 2022
830c47c
Pass bt_factory to ast.Program node to circumvent circular imports
alexisthedev Aug 25, 2022
c9bc3f8
add type alias ast node to typescript-specific AST file extension
alexisthedev Aug 25, 2022
23d266b
(WIP) Add TypeAlias type, extend generator, context, and visitors for…
alexisthedev Aug 25, 2022
dd50a30
Add support for type alias, extend typescript translator for builting…
alexisthedev Aug 26, 2022
e74b680
Correct the primitive status of typescript built-in types
alexisthedev Aug 16, 2022
2211142
Merge support for literal types and null, undefined types
alexisthedev Aug 23, 2022
38316d1
remove comment
alexisthedev Aug 24, 2022
b18dc82
add newline to end of file
alexisthedev Aug 25, 2022
6535c3f
Add full support for typescript number and string literal types
alexisthedev Aug 29, 2022
15fdb86
Provide generator with both a string and number literal type, change …
alexisthedev Aug 30, 2022
94b2ea1
Rename method and add spaces
alexisthedev Aug 30, 2022
dd45e0a
Fix subtyping bugfor type aliases
alexisthedev Sep 15, 2022
2cf7639
Merge literal types from main to ts-type-alias
alexisthedev Sep 15, 2022
d25ca76
Add requested type alias changes
alexisthedev Sep 16, 2022
53ac9b1
Add Type Alias Unit Tests
alexisthedev Sep 19, 2022
a3350e9
Move method gen_identifier to src.utils.RandomUtils
alexisthedev Sep 19, 2022
a8f85b8
Add unit test and subtyping relations for type alias with equal literals
alexisthedev Sep 19, 2022
9020ff9
Rewrite generator lambda functions
alexisthedev Sep 19, 2022
50007dd
Merge pull request #13 from alexisthedev/ts-type-alias
theosotr Sep 19, 2022
5122ed3
Add GSOC.md
alexisthedev Oct 10, 2022
5a4be54
Add deployment script for running and installing typescript, npm
alexisthedev Nov 9, 2022
3d30d15
Update run.sh and setup.sh
alexisthedev Nov 10, 2022
362ec91
Add typescript option to run.sh
alexisthedev Nov 10, 2022
bd06ca2
Modify python command to use newer python version
alexisthedev Nov 10, 2022
4c44200
Remove transformations when running hephaestus for typescript at remo…
alexisthedev Nov 10, 2022
9d4a002
Correct the primitive status of typescript built-in types
alexisthedev Aug 16, 2022
8a42ca2
Merge literal types from main to ts-type-alias
alexisthedev Aug 23, 2022
7f76da3
Add full support for typescript number and string literal types
alexisthedev Aug 29, 2022
8dc152a
Add UnionType class and UnionTypeFactory
alexisthedev Aug 30, 2022
93d9ae5
Add limit for types in a union
alexisthedev Aug 31, 2022
f075f3a
Pass union types to generator and translate them to typescript
alexisthedev Aug 31, 2022
43322bd
Fix union type handling of literal types
alexisthedev Aug 31, 2022
8aa2dd1
Expand generator to generate union type constants
alexisthedev Aug 31, 2022
49cb8af
Pass and generate union types with previously generated types
alexisthedev Sep 1, 2022
f3ee755
Add union type assignment test, update tests to pass builtin factory …
alexisthedev Sep 5, 2022
338420b
Change default is_subtype function for builtin types. Add unit tests …
alexisthedev Sep 14, 2022
09ccae6
Fix subtyping relations for union types
alexisthedev Sep 14, 2022
ab9c0d7
Add an extra subtyping check for when additional subtyping relations …
alexisthedev Sep 20, 2022
2182d54
Refactoring of Type Substitution Mechanism
alexisthedev Sep 23, 2022
ff26ffe
Add functionality for union types type substitution
alexisthedev Sep 29, 2022
3e06d6f
Add more unit tests for union type substitution
alexisthedev Sep 29, 2022
291397b
Add type unification support for union types
alexisthedev Sep 30, 2022
123d20a
Add unit tests for union type unification
alexisthedev Sep 30, 2022
4bf17c6
Change assertion statement to include union type cases
alexisthedev Sep 30, 2022
832c73a
Refactor and fully outline the procedure for type unification for uni…
alexisthedev Oct 19, 2022
e385331
Add more unit tests for type unification, solve bugs in the type unif…
alexisthedev Nov 2, 2022
137b474
Remove dead import
theosotr Nov 11, 2022
26e58f9
Fix type unification for type params and combound types
theosotr Nov 14, 2022
2ee782c
Correctly remove type variables from a union type
theosotr Nov 14, 2022
cbd3399
Add one more typescript keyword
theosotr Nov 15, 2022
d13bc03
Name changes and resolving PR comments
alexisthedev Nov 23, 2022
93ce961
Make builtin factory set up factories for individual types
theosotr Nov 23, 2022
790fff8
Add description comments to unit tests
alexisthedev Nov 23, 2022
adea32d
Change name of dynamic_subtyping
alexisthedev Nov 23, 2022
8574c78
substitute_type_args => substitute_type
theosotr Nov 23, 2022
081fea7
Merge branch 'hephaestus-compiler-project:main' into main
theosotr Nov 23, 2022
6654144
Install typescript nightly build from seperate function
alexisthedev Dec 7, 2022
101d787
remove GSOC.md from central repo pull request
alexisthedev Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,12 @@ dmypy.json

# Pyre type checker
.pyre/

# VSCode / pylint
.vscode/
./pylintrc

# Local Folder to Store Possible Bugs
possible_bugs/
patterns.txt

19 changes: 18 additions & 1 deletion deployment/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ run_groovy_from_source() {
--language groovy --cast-numbers
}

install_ts_nightly() {
npm install -g typescript@next
}

run_typescript() {
python3.9 hephaestus.py -s $TIME_TO_RUN -t 0 -w $CORES --batch 30 -P \
--language typescript --disable-use-site-variance \
--error-filter-patterns patterns.txt
}

run_multiple_versions() {
cd $CHECK_TYPE_SYSTEMS
git pull
Expand All @@ -68,13 +78,18 @@ then
exit 0
fi

while getopts "hksagS" OPTION; do
while getopts "hkstagS" OPTION; do
case $OPTION in

k)
simple_run
;;

t)
install_ts_nightly
run_typescript
;;

s)
run_from_source
;;
Expand All @@ -94,12 +109,14 @@ while getopts "hksagS" OPTION; do
h)
echo "Usage:"
echo "init.sh -k "
echo "init.sh -t "
echo "init.sh -s "
echo "init.sh -a "
echo "init.sh -g "
echo "init.sh -S "
echo ""
echo " -k Simple run"
echo " -t Install latest typescript nightly version"
echo " -s Run from source"
echo " -a Run multiple versions"
echo " -g Simple run groovy"
Expand Down
18 changes: 17 additions & 1 deletion deployment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ install_groovy_from_source() {
source $HOME/.bash_profile
}

install_npm() {
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
nvm install node
}

install_typescript() {
npm install -g typescript@next
}

install_kotlin() {
install_java
sdk install kotlin
Expand Down Expand Up @@ -170,7 +179,7 @@ then
exit 0
fi

while getopts "hskagS" OPTION; do
while getopts "hsktagS" OPTION; do
case $OPTION in

k)
Expand All @@ -180,6 +189,11 @@ while getopts "hskagS" OPTION; do
add_run_script_to_path
;;

t)
install_npm
install_typescript
;;

s)
install_deps
install_kotlin_from_source
Expand Down Expand Up @@ -211,12 +225,14 @@ while getopts "hskagS" OPTION; do
h)
echo "Usage:"
echo "init.sh -k "
echo "init.sh -t "
echo "init.sh -s "
echo "init.sh -a "
echo "init.sh -g "
echo "init.sh -S "
echo ""
echo " -k Install latest kotlin version"
echo " -t Install latest typescript nightly version"
echo " -s Install kotlin from source"
echo " -a Install all kotlin versions"
echo " -g Install latest groovy version"
Expand Down
8 changes: 6 additions & 2 deletions hephaestus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,26 @@
from src.compilers.kotlin import KotlinCompiler
from src.compilers.groovy import GroovyCompiler
from src.compilers.java import JavaCompiler
from src.compilers.typescript import TypeScriptCompiler
from src.translators.kotlin import KotlinTranslator
from src.translators.groovy import GroovyTranslator
from src.translators.java import JavaTranslator
from src.translators.typescript import TypeScriptTranslator
from src.modules.processor import ProgramProcessor


STOP_COND = False
TRANSLATORS = {
'kotlin': KotlinTranslator,
'groovy': GroovyTranslator,
'java': JavaTranslator
'java': JavaTranslator,
'typescript' : TypeScriptTranslator
}
COMPILERS = {
'kotlin': KotlinCompiler,
'groovy': GroovyCompiler,
'java': JavaCompiler
'java': JavaCompiler,
'typescript': TypeScriptCompiler
}
STATS = {
"Info": {
Expand Down
Loading