-
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.
- Loading branch information
Showing
5 changed files
with
68 additions
and
1 deletion.
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,7 @@ | ||
package api | ||
|
||
import "testing" | ||
|
||
func TestExecNoImports(t *testing.T) { | ||
exec("/Users/emicklei/Projects/github.com/emicklei/varvoy/todebug/noimports", nil) | ||
} |
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,53 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"go/parser" | ||
"go/token" | ||
) | ||
|
||
func main() { | ||
src1 := ` | ||
package main | ||
import "fmt" | ||
func main() { | ||
fmt.Println("Hello, World!") | ||
} | ||
` | ||
set := token.NewFileSet() | ||
expr, err := parser.ParseFile(set, "main.go", src1, parser.ParseComments) | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Println(expr) | ||
{ | ||
src2 := ` | ||
package main | ||
import "fmt" | ||
func main() { | ||
fmt.Println("Hello, Varvoy!") | ||
} | ||
` | ||
set := token.NewFileSet() | ||
expr2, err := parser.ParseFile(set, "main.go", src2, parser.ParseComments) | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Println(expr2) | ||
} | ||
/** | ||
1: strategies for finding the changed functions: | ||
compare functions by comparing the start and end pos of each function | ||
-> need to keep this data in memory | ||
-> also some hashcode, content may have same size but is different | ||
2: dont care about the changes, just reload the whole file | ||
-> see how REPL works | ||
**/ | ||
} |
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