Compiler (#23)
* implemented add, mul, div, sub assign for identifiers. * Implemented struct field initialization. * Implemented imports * Implemented storage VM API (interop layer) + additional bug fixes when encountered. * Bumped version 0.12.0 * fixed double point extension on compiled output file. * Fixed bug where callExpr in returns where added to voidCall * fixed binExpr compare equal * Check the env for the gopath first * removed travis.yml * custom types + implemented general declarations. * commented out the storage test to make the build pass
This commit is contained in:
parent
bebdabab9f
commit
23cfebf621
25 changed files with 798 additions and 117 deletions
|
@ -1,4 +1,4 @@
|
|||
package compiler_test
|
||||
package compiler
|
||||
|
||||
var binaryExprTestCases = []testCase{
|
||||
{
|
||||
|
@ -69,4 +69,46 @@ var binaryExprTestCases = []testCase{
|
|||
`,
|
||||
"54c56b546c766b00527ac4586c766b51527ac46c766b00c35293529358946c766b52527ac46203006c766b51c36c766b52c395616c7566",
|
||||
},
|
||||
{
|
||||
"compare equal strings",
|
||||
`
|
||||
package testcase
|
||||
func Main() int {
|
||||
str := "a string"
|
||||
if str == "another string" {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
`,
|
||||
"54c56b086120737472696e676c766b00527ac46c766b00c30e616e6f7468657220737472696e679c640b0062030051616c756662030000616c7566",
|
||||
},
|
||||
{
|
||||
"compare equal ints",
|
||||
`
|
||||
package testcase
|
||||
func Main() int {
|
||||
x := 10
|
||||
if x == 10 {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
`,
|
||||
"54c56b5a6c766b00527ac46c766b00c35a9c640b0062030051616c756662030000616c7566",
|
||||
},
|
||||
{
|
||||
"compare not equal ints",
|
||||
`
|
||||
package testcase
|
||||
func Main() int {
|
||||
x := 10
|
||||
if x != 10 {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
`,
|
||||
"54c56b5a6c766b00527ac46c766b00c35a9c640b0062030051616c756662030000616c7566",
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue