Go to file
Alan Donovan 25a0cc4bfd go.tools/oracle: refactor Oracle API to allow repeated queries on same scope.
The existing standalone Query function builds an importer, ssa.Program, oracle,
and query position, executes the query and returns the result.
For clients (such as Frederik Zipp's web-based github.com/fzipp/pythia tool)
that wish to load the program once and make several queries, we now expose
these as separate operations too.  Here's a client, in pseudocode:

        o := oracle.New(...)
        for ... {
                qpos := o.ParseQueryPos(...)
                res := o.Query(mode, qpos)
                print result
        }

NB: this is a slight deoptimisation in the one-shot case since we have to
build the entire SSA program with debug info, not just the query package,
since we now don't know the query package at that time.

The 'exact' param to ParseQueryPos needs more thought since its
ideal value is a function of the query mode.  This will do for now.

Details:
- expose Oracle type, New() func and Query() method.
- expose QueryPos type and ParseQueryPos func.
- improved package doc comment.
- un-exposed the "needs" bits.
- added test.

R=crawshaw
CC=frederik.zipp, golang-dev
https://golang.org/cl/13810043
2013-09-23 15:02:18 -04:00
blog go.tools/blog: use atom and present packages from go.tools 2013-09-19 10:58:36 +10:00
cmd go.tools/cmd/cover: add content-type meta tag to HTML output 2013-09-23 13:57:03 +10:00
dashboard go.tools/dashboard: add option to build gccgo revisions 2013-09-11 16:45:24 -07:00
go go.tools/go/types: enable more std lib tests 2013-09-20 10:09:40 -07:00
godoc go.tools/blog: use atom and present packages from go.tools 2013-09-19 10:58:36 +10:00
importer go.tools/go/types: separate package descriptor from package object 2013-09-13 09:52:57 -07:00
oracle go.tools/oracle: refactor Oracle API to allow repeated queries on same scope. 2013-09-23 15:02:18 -04:00
playground go.tools/playground/socket: move package from go.talks 2013-09-19 10:59:00 +10:00
pointer go.tools/pointer: fix pointer tests (fix build partly) 2013-09-18 11:37:26 -07:00
present go.tools/godoc/present: move present package from go.talks 2013-09-19 10:55:46 +10:00
ssa go.tools/ssa: fix ssa tests (fix build partly) 2013-09-18 11:39:55 -07:00
.hgignore go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools: provide the right README 2013-05-17 12:55:10 -07:00
codereview.cfg go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00

README

This subrepository holds the source for various packages and tools that support
the Go programming language.

Although at least some of the tools themselves will be included in binary Go distributions,
the packages from which they are built are of little interest to most Go programmers.

To submit changes to this repository, see http://golang.org/doc/contribute.html.