-
Notifications
You must be signed in to change notification settings - Fork 32
Add code generation for bbml #245
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
Merged
The head ref may contain hidden characters: "bbml-codegen\u{1F9C3}"
Merged
Changes from 16 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
f654551
Map builtin operators
NeilKleistGao 270ff3e
WIP: Fix num and sel code gen & add predef
NeilKleistGao 6896564
WIP: Add throw
NeilKleistGao c25ebd5
WIP: Fix predef
NeilKleistGao b9e3782
Fix getter generation & split.end typing
NeilKleistGao dc58521
Generate code for region & ref
NeilKleistGao 7c56b26
WIP: Add tests
NeilKleistGao a40e1cc
Merge from main branch
NeilKleistGao c2deec1
Fix class matching typing
NeilKleistGao ddeb04a
Merge from main branch
NeilKleistGao a81aae2
Fix num ops code gen
NeilKleistGao dae1d36
Fix getter generation
NeilKleistGao 4afe46f
Clean
NeilKleistGao b0c3f38
Merge from mlscript
NeilKleistGao a683de6
Update bbml predef
NeilKleistGao af42e40
Minor
NeilKleistGao 182237f
Reuse getBuiltin
NeilKleistGao 5443f1f
Fix GetElem implementation
NeilKleistGao 89f5c6c
Merge branch 'hkmc2' of https://github.com/hkust-taco/mlscript into b…
NeilKleistGao ebe9103
Rerun tests
NeilKleistGao 8e63fae
Move defn check to symbol
NeilKleistGao 0ff406f
Fix module getter generation and ctx.get use
NeilKleistGao ce6f2cf
Refactor getter typing
NeilKleistGao e0a22ad
Update hkmc2/shared/src/main/scala/hkmc2/semantics/Elaborator.scala
NeilKleistGao 313d680
Merge from main branch
NeilKleistGao 0bb46f1
WIP: Fix shadowing
NeilKleistGao 5557984
Forbid getters from being defined in non-module and non-function scopes
NeilKleistGao 52e2bd2
Update hkmc2/shared/src/main/scala/hkmc2/semantics/Term.scala
NeilKleistGao ae7bfd5
Remove top-level getter selection check
NeilKleistGao bbc8f9f
Add empty lines
NeilKleistGao 710831f
Fix diff
NeilKleistGao 6e7a96a
Fix diff
NeilKleistGao 7ca79b9
Fix getter logic
NeilKleistGao 634748d
Merge from main branch
NeilKleistGao e0c2e5e
Minor changes
NeilKleistGao ea0c9c8
Remove the unused import and update the comment
NeilKleistGao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,31 @@ | ||
const Predef$class = class Predef { | ||
constructor() { | ||
|
||
} | ||
checkArgs(functionName, expected, got) { | ||
let scrut, name, scrut1, tmp, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; | ||
scrut = got != expected; | ||
if (scrut) { | ||
scrut1 = functionName.length > 0; | ||
if (scrut1) { | ||
tmp = " '".concat(functionName); | ||
tmp1 = tmp.concat("'"); | ||
} else { | ||
tmp1 = ""; | ||
} | ||
name = tmp1; | ||
tmp2 = "Function".concat(name); | ||
tmp3 = tmp2.concat(" expected "); | ||
tmp4 = tmp3.concat(expected); | ||
tmp5 = tmp4.concat(" arguments but got "); | ||
tmp6 = tmp5.concat(got); | ||
throw new Error.class(tmp6); | ||
} else { | ||
return undefined; | ||
} | ||
} | ||
toString() { return "Predef"; } | ||
}; const Predef = new Predef$class; | ||
Predef.class = Predef$class; | ||
undefined | ||
export default Predef; |
This file contains hidden or 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,7 @@ | ||
module Predef with ... | ||
|
||
fun checkArgs(functionName, expected, got) = | ||
if got != expected then | ||
let name = if functionName.Str#length > 0 then " '".Str#concat(functionName).Str#concat("'") else "" | ||
throw new Error("Function".Str#concat(name).Str#concat(" expected ").Str#concat(expected).Str#concat(" arguments but got ").Str#concat(got)) | ||
else () |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.