8000 gore/main.go at master · morika-t/gore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8D3B script type="application/json" data-target="react-app.embeddedData">{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"doc","path":"doc","contentType":"directory"},{"name":".travis.yml","path":".travis.yml","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.adoc","path":"README.adoc","contentType":"file"},{"name":"commands.go","path":"commands.go","contentType":"file"},{"name":"complete.go","path":"complete.go","contentType":"file"},{"name":"complete_test.go","path":"complete_test.go","contentType":"file"},{"name":"debug.go","path":"debug.go","contentType":"file"},{"name":"gocode.go","path":"gocode.go","contentType":"file"},{"name":"gocode_test.go","path":"gocode_test.go","contentType":"file"},{"name":"helpers_test.go","path":"helpers_test.go","contentType":"file"},{"name":"liner.go","path":"liner.go","contentType":"file"},{"name":"log.go","path":"log.go","contentType":"file"},{"name":"main.go","path":"main.go","contentType":"file"},{"name":"node.go","path":"node.go","contentType":"file"},{"name":"node_test.go","path":"node_test.go","contentType":"file"},{"name":"quickfix.go","path":"quickfix.go","contentType":"file"},{"name":"session_test.go","path":"session_test.go","contentType":"file"}],"totalCount":18}},"fileTreeProcessingTime":7.599240999999999,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":31354195,"defaultBranch":"master","name":"gore","ownerLogin":"morika-t","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2015-02-26T06:43:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1606736?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1619179091.0349069","canEdit":false,"refType":"branch","currentOid":"acb226f9fa7532a0e68806547796af4448c6152c"},"path":"main.go","currentUser":null,"blob":{"rawLines":["/*","Yet another Go REPL that works nicely. Featured with line editing, code completion and more.","","Usage","","When started, a prompt is shown waiting for input. Enter any statement or expression to proceed.","If an expression is given or any variables are assigned or defined, their data will be pretty-printed.","","Some special functionalities are provided as commands, which starts with colons:","","\t:import \u003cpackage path\u003e Imports a package","\t:print Prints current source code","\t:write [\u003cfilename\u003e] Writes out current code","\t:doc \u003ctarget\u003e Shows documentation for an expression or package name given","\t:help Lists commands","*/","package main","","import (","\t\"bytes\"","\t\"fmt\"","\t\"io\"","\t\"io/ioutil\"","\t\"os\"","\t\"os/exec\"","\t\"path/filepath\"","\t\"strings\"","\t\"syscall\"","","\t\"go/ast\"","\t\"go/parser\"","\t\"go/printer\"","\t\"go/scanner\"","\t\"go/token\"","\t_ \"golang.org/x/tools/go/gcimporter\"","\t\"golang.org/x/tools/go/types\"","","\t\"github.com/mitchellh/go-homedir\"",")","","const version = \"0.0.0\"","const printerName = \"__gore_p\"","","func main() {","\ts, err := NewSession()","\tif err != nil {","\t\tpanic(err)","\t}","","\tfmt.Printf(\"gore version %s :help for help\\n\", version)","","\trl := newContLiner()","\tdefer rl.Close()","","\tvar historyFile string","\thome, err := homeDir()","\tif err != nil {","\t\terrorf(\"home: %s\", err)","\t} else {","\t\thistoryFile = filepath.Join(home, \"history\")","","\t\tf, err := os.Open(historyFile)","\t\tif err != nil {","\t\t\tif !os.IsNotExist(err) {","\t\t\t\terrorf(\"%s\", err)","\t\t\t}","\t\t} else {","\t\t\t_, err := rl.ReadHistory(f)","\t\t\tif err != nil {","\t\t\t\terrorf(\"while reading history: %s\", err)","\t\t\t}","\t\t}","\t}","","\trl.SetWordCompleter(s.completeWord)","","\tfor {","\t\tin, err := rl.Prompt()","\t\tif err != nil {","\t\t\tif err == io.EOF {","\t\t\t\tbreak","\t\t\t}","\t\t\tfmt.Fprintf(os.Stderr, \"fatal: %s\", err)","\t\t\tos.Exit(1)","\t\t}","","\t\tif in == \"\" {","\t\t\tcontinue","\t\t}","","\t\terr = s.Eval(in)","\t\tif err != nil {","\t\t\tif err == ErrContinue {","\t\t\t\tcontinue","\t\t\t}","\t\t\tfmt.Println(err)","\t\t}","\t\trl.Accepted()","\t}","","\tif historyFile != \"\" {","\t\terr := os.MkdirAll(filepath.Dir(historyFile), 0755)","\t\tif err != nil {","\t\t\terrorf(\"%s\", err)","\t\t} else {","\t\t\tf, err := os.Create(historyFile)","\t\t\tif err != nil {","\t\t\t\terrorf(\"%s\", err)","\t\t\t} else {","\t\t\t\t_, err := rl.WriteHistory(f)","\t\t\t\tif err != nil {","\t\t\t\t\terrorf(\"while saving history: %s\", err)","\t\t\t\t}","\t\t\t}","\t\t}","\t}","}","","func homeDir() (home string, err error) {","\thome = os.Getenv(\"GORE_HOME\")","\tif home != \"\" {","\t\treturn","\t}","","\thome, err = homedir.Dir()","\tif err != nil {","\t\treturn","\t}","","\thome = filepath.Join(home, \".gore\")","\treturn","}","","type Session struct {","\tFilePath string","\tFile *ast.File","\tFset *token.FileSet","\tTypes *types.Config","\tTypeInfo types.Info","","\tmainBody *ast.BlockStmt","\tstoredBodyLength int","}","","const initialSourceTemplate = `","package main","","import %q","","func ` + printerName + `(xx ...interface{}) {","\tfor _, x := range xx {","\t\t%s","\t}","}","","func main() {","}","`","","// printerPkgs is a list of packages that provides","// pretty printing function. Preceding first.","var printerPkgs = []struct {","\tpath string","\tcode string","}{","\t{\"github.com/k0kubun/pp\", `pp.Println(x)`},","\t{\"github.com/davecgh/go-spew/spew\", `spew.Printf(\"%#v\\n\", x)`},","\t{\"fmt\", `fmt.Printf(\"%#v\\n\", x)`},","}","","func NewSession() (*Session, error) {","\tvar err error","","\ts := \u0026Session{","\t\tFset: token.NewFileSet(),","\t\tTypes: \u0026types.Config{","\t\t\tPackages: make(map[string]*types.Package),","\t\t},","\t}","","\ts.FilePath, err = tempFile()","\tif err != nil {","\t\treturn nil, err","\t}","","\tvar initialSource string","\tfor _, pp := range printerPkgs {","\t\t_, err := types.DefaultImport(s.Types.Packages, pp.path)","\t\tif err == nil {","\t\t\tinitialSource = fmt.Sprintf(initialSourceTemplate, pp.path, pp.code)","\t\t\tbreak","\t\t}","\t\tdebugf(\"could not import %q: %s\", pp.path, err)","\t}","","\tif initialSource == \"\" {","\t\treturn nil, fmt.Errorf(`Could not load pretty printing package (even \"fmt\"; something is wrong)`)","\t}","","\ts.File, err = parser.ParseFile(s.Fset, \"gore_session.go\", initialSource, parser.Mode(0))","\tif err != nil {","\t\treturn nil, err","\t}","","\ts.mainBody = s.mainFunc().Body","","\treturn s, nil","}","","func (s *Session) mainFunc() *ast.FuncDecl {","\treturn s.File.Scope.Lookup(\"main\").Decl.(*ast.FuncDecl)","}","","func (s *Session) Run() error {","\tf, err := os.Create(s.FilePath)","\tif err != nil {","\t\treturn err","\t}","","\terr = printer.Fprint(f, s.Fset, s.File)","\tif err != nil {","\t\treturn err","\t}","","\treturn goRun(s.FilePath)","}","","func tempFile() (string, error) {","\tdir, err := ioutil.TempDir(\"\", \"\")","\tif err != nil {","\t\treturn \"\", err","\t}","","\terr = os.MkdirAll(dir, 0755)","\tif err != nil {","\t\treturn \"\", err","\t}","","\treturn filepath.Join(dir, \"gore_session.go\"), nil","}","","func goRun(file string) error {","\tdebugf(\"go run %s\", file)","","\tcmd := exec.Command(\"go\", \"run\", file)","\tcmd.Stdin = os.Stdin","\tcmd.Stdout = os.Stdout","\tcmd.Stderr = os.Stderr","\treturn cmd.Run()","}","","func (s *Session) evalExpr(in string) (ast.Expr, error) {","\texpr, err := parser.ParseExpr(in)","\tif err != nil {","\t\treturn nil, err","\t}","","\tstmt := \u0026ast.ExprStmt{","\t\tX: \u0026ast.CallExpr{","\t\t\tFun: ast.NewIdent(printerName),","\t\t\tArgs: []ast.Expr{expr},","\t\t},","\t}","","\ts.appendStatements(stmt)","","\treturn expr, nil","}","","func isNamedIdent(expr ast.Expr, name string) bool {","\tident, ok := expr.(*ast.Ident)","\treturn ok \u0026\u0026 ident.Name == name","}","","func (s *Session) evalStmt(in string) error {","\tsrc := fmt.Sprintf(\"package P; func F() { %s }\", in)","\tf, err := parser.ParseFile(s.Fset, \"stmt.go\", src, parser.Mode(0))","\tif err != nil {","\t\treturn err","\t}","","\tenclosingFunc := f.Scope.Lookup(\"F\").Decl.(*ast.FuncDecl)","\tstmts := enclosingFunc.Body.List","","\tif len(stmts) \u003e 0 {","\t\tlastStmt := stmts[len(stmts)-1]","\t\t// print last assigned/defined values","\t\tif assign, ok := lastStmt.(*ast.AssignStmt); ok {","\t\t\tvs := []ast.Expr{}","\t\t\tfor _, v := range assign.Lhs {","\t\t\t\tif !isNamedIdent(v, \"_\") {","\t\t\t\t\tvs = append(vs, v)","\t\t\t\t}","\t\t\t}","\t\t\tif len(vs) \u003e 0 {","\t\t\t\tprintLastValues := \u0026ast.ExprStmt{","\t\t\t\t\tX: \u0026ast.CallExpr{","\t\t\t\t\t\tFun: ast.NewIdent(printerName),","\t\t\t\t\t\tArgs: vs,","\t\t\t\t\t},","\t\t\t\t}","\t\t\t\tstmts = append(stmts, printLastValues)","\t\t\t}","\t\t}","\t}","","\ts.appendStatements(stmts...)","","\treturn nil","}","","func (s *Session) appendStatements(stmts ...ast.Stmt) {","\ts.mainBody.List = append(s.mainBody.List, stmts...)","}","","type Error string","","const (","\tErrContinue Error = \"\u003ccontinue input\u003e\"",")","","func (e Error) Error() string {","\treturn string(e)","}","","func (s *Session) source(space bool) (string, error) {","\tnormalizeNodePos(s.mainFunc())","","\tvar config *printer.Config","\tif space {","\t\tconfig = \u0026printer.Config{","\t\t\tMode: printer.UseSpaces,","\t\t\tTabwidth: 4,","\t\t}","\t} else {","\t\tconfig = \u0026printer.Config{","\t\t\tTabwidth: 8,","\t\t}","\t}","","\tvar buf bytes.Buffer","\terr := config.Fprint(\u0026buf, s.Fset, s.File)","\treturn buf.String(), err","}","","func (s *Session) Eval(in string) error {","\tdebugf(\"eval \u003e\u003e\u003e %q\", in)","","\ts.clearQuickFix()","\ts.storeMainBody()","","\tvar commandRan bool","\tfor _, command := range commands {","\t\targ := strings.TrimPrefix(in, \":\"+command.name)","\t\tif arg == in {","\t\t\tcontinue","\t\t}","","\t\tif arg == \"\" || strings.HasPrefix(arg, \" \") {","\t\t\targ = strings.TrimSpace(arg)","\t\t\terr := command.action(s, arg)","\t\t\tif err != nil {","\t\t\t\terrorf(\"%s: %s\", command.name, err)","\t\t\t}","\t\t\tcommandRan = true","\t\t\tbreak","\t\t}","\t}","","\tif commandRan {","\t\ts.doQuickFix()","\t\treturn nil","\t}","","\tif _, err := s.evalExpr(in); err != nil {","\t\tdebugf(\"expr :: err = %s\", err)","","\t\terr := s.evalStmt(in)","\t\tif err != nil {","\t\t\tdebugf(\"stmt :: err = %s\", err)","","\t\t\tif _, ok := err.(scanner.ErrorList); ok {","\t\t\t\treturn ErrContinue","\t\t\t}","\t\t}","\t}","","\ts.doQuickFix()","","\terr := s.Run()","\tif err != nil {","\t\tif exitErr, ok := err.(*exec.ExitError); ok {","\t\t\t// if failed with status 2, remove the last statement","\t\t\tif st, ok := exitErr.ProcessState.Sys().(syscall.WaitStatus); ok {","\t\t\t\tif st.ExitStatus() == 2 {","\t\t\t\t\tdebugf(\"got exit status 2, popping out last input\")","\t\t\t\t\ts.restoreMainBody()","\t\t\t\t}","\t\t\t}","\t\t}","\t\terrorf(\"%s\", err)","\t}","","\treturn err","}","","// storeMainBody stores current state of code so that it can be restored","// actually it saves the length of statements inside main()","func (s *Session) storeMainBody() {","\ts.storedBodyLength = len(s.mainBody.List)","}","","func (s *Session) restoreMainBody() {","\ts.mainBody.List = s.mainBody.List[0:s.storedBodyLength]","}"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/morika-t/gore/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"main.go","displayUrl":"https://github.com/morika-t/gore/blob/master/main.go?raw=true","headerInfo":{"blobSize":"7.75 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"f7dce06","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fmorika-t%2Fgore%2Fblob%2Fmaster%2Fmain.go","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"415","truncatedSloc":"340"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Go","languageID":132,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/morika-t/gore/blob/master/main.go","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/morika-t/gore/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/morika-t/gore/raw/refs/heads/master/main.go","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"version","kind":"constant","ident_start":951,"ident_end":958,"extent_start":961,"extent_end":968,"fully_qualified_name":"version","ident_utf16":{"start":{"line_number":40,"utf16_col":6},"end":{"line_number":40,"utf16_col":13}},"extent_utf16":{"start":{"line_number":40,"utf16_col":16},"end":{"line_number":40,"utf16_col":23}}},{"name":"printerName","kind":"constant","ident_start":975,"ident_end":986,"extent_start":989,"extent_end":999,"fully_qualified_name":"printerName","ident_utf16":{"start":{"line_number":41,"utf16_col":6},"end":{"line_number":41,"utf16_col":17}},"extent_utf16":{"start":{"line_number":41,"utf16_col":20},"end":{"line_number":41,"utf16_col":30}}},{"name":"main","kind":"function","ident_start":1006,"ident_end":1010,"extent_start":1001,"extent_end":2228,"fully_qualified_name":"main","ident_utf16":{"start":{"line_number":43,"utf16_col":5},"end":{"line_number":43,"utf16_col":9}},"extent_utf16":{"start":{"line_number":43,"utf16_col":0},"end":{"line_number":116,"utf16_col":1}}},{"name":"homeDir","kind":"function","ident_start":2235,"ident_end":2242,"extent_start":2230,"extent_end":2436,"fully_qualified_name":"homeDir","ident_utf16":{"start":{"line_number":118,"utf16_col":5},"end":{"line_number":118,"utf16_col":12}},"extent_utf16":{"start":{"line_number":118,"utf16_col":0},"end":{"line_number":131,"utf16_col":1}}},{"name":"Session","kind":"class","ident_start":2443,"ident_end":2450,"extent_start":2438,"extent_end":2624,"fully_qualified_name":"Session","ident_utf16":{"start":{"line_number":133,"utf16_col":5},"end":{"line_number":133,"utf16_col":12}},"extent_utf16":{"start":{"line_number":133,"utf16_col":0},"end":{"line_number":142,"utf16_col":1}}},{"name":"FilePath","kind":"field","ident_start":2461,"ident_end":2469,"extent_start":2461,"extent_end":2476,"fully_qualified_name":"Session.FilePath","ident_utf16":{"start":{"line_number":134,"utf16_col":1},"end":{"line_number":134,"utf16_col":9}},"extent_utf16":{"start":{"line_number":134,"utf16_col":1},"end":{"line_number":134,"utf16_col":16}}},{"name":"File","kind":"field","ident_start":2478,"ident_end":2482,"extent_start":2478,"extent_end":2496,"fully_qualified_name":"Session.File","ident_utf16":{"start":{"line_number":135,"utf16_col":1},"end":{"line_number":135,"utf16_col":5}},"extent_utf16":{"start":{"line_number":135,"utf16_col":1},"end":{"line_number":135,"utf16_col":19}}},{"name":"Fset","kind":"field","ident_start":2498,"ident_end":2502,"extent_start":2498,"extent_end":2521,"fully_qualified_name":"Session.Fset","ident_utf16":{"start":{"line_number":136,"utf16_col":1},"end":{"line_number":136,"utf16_col":5}},"extent_utf16":{"start":{"line_number":136,"utf16_col":1},"end":{"line_number":136,"utf16_col":24}}},{"name":"Types","kind":"field","ident_start":2523,"ident_end":2528,"extent_start":2523,"extent_end":2545,"fully_qualified_name":"Session.Types","ident_utf16":{"start":{"line_number":137,"utf16_col":1},"end":{"line_number":137,"utf16_col":6}},"extent_utf16":{"start":{"line_number":137,"utf16_col":1},"end":{"line_number":137,"utf16_col":23}}},{"name":"TypeInfo","kind":"field","ident_start":2547,"ident_end":2555,"extent_start":2547,"extent_end":2566,"fully_qualified_name":"Session.TypeInfo","ident_utf16":{"start":{"line_number":138,"utf16_col":1},"end":{"line_number":138,"utf16_col":9}},"extent_utf16":{"start":{"line_number":138,"utf16_col":1},"end":{"line_number":138,"utf16_col":20}}},{"name":"mainBody","kind":"field","ident_start":2569,"ident_end":2577,"extent_start":2569,"extent_end":2600,"fully_qualified_name":"Session.mainBody","ident_utf16":{"start":{"line_number":140,"utf16_col":1},"end":{"line_number":140,"utf16_col":9}},"extent_utf16":{"start":{"line_number":140,"utf16_col":1},"end":{"line_number":140,"utf16_col":32}}},{"name":"storedBodyLength","kind":"field","ident_start":2602,"ident_end":2618,"extent_start":2602,"extent_end":2622,"fully_qualified_name":"Session.storedBodyLength","ident_utf16":{"start":{"line_number":141,"utf16_col":1},"end":{"line_number":141,"utf16_col":17}},"extent_utf16":{"start":{"line_number":141,"utf16_col":1},"end":{"line_number":141,"utf16_col":21}}},{"name":"initialSourceTemplate","kind":"constant","ident_start":2632,"ident_end":2653,"extent_start":2656,"extent_end":2781,"fully_qualified_name":"initialSourceTemplate","ident_utf16":{"start":{"line_number":144,"utf16_col":6},"end":{"line_number":144,"utf16_col":27}},"extent_utf16":{"start":{"line_number":144,"utf16_col":30},"end":{"line_number":157,"utf16_col":1}}},{"name":"path","kind":"field","ident_start":2910,"ident_end":2914,"extent_start":2910,"extent_end":2921,"fully_qualified_name":"path","ident_utf16":{"start":{"line_number":162,"utf16_col":1},"end":{"line_number":162,"utf16_col":5}},"extent_utf16":{"start":{"line_number":162,"utf16_col":1},"end":{"line_number":162,"utf16_col":12}}},{"name":"code","kind":"field","ident_start":2923,"ident_end":2927,"extent_start":2923,"extent_end":2934,"fully_qualified_name":"code","ident_utf16":{"start":{"line_number":163,"utf16_col":1},"end":{"line_number":163,"utf16_col":5}},"extent_utf16":{"start":{"line_number":163,"utf16_col":1},"end":{"line_number":163,"utf16_col":12}}},{"name":"NewSession","kind":"function","ident_start":3092,"ident_end":3102,"extent_start":3087,"extent_end":3917,"fully_qualified_name":"NewSession","ident_utf16":{"start":{"line_number":170,"utf16_col":5},"end":{"line_number":170,"utf16_col":15}},"extent_utf16":{"start":{"line_number":170,"utf16_col":0},"end":{"line_number":207,"utf16_col":1}}},{"name":"mainFunc","kind":"method","ident_start":3937,"ident_end":3945,"extent_start":3919,"extent_end":4022,"fully_qualified_name":"Session.mainFunc","ident_utf16":{"start":{"line_number":209,"utf16_col":18},"end":{"line_number":209,"utf16_col":26}},"extent_utf16":{"start":{"line_number":209,"utf16_col":0},"end":{"line_number":211,"utf16_col":1}}},{"name":"Run","kind":"method","ident_start":4042,"ident_end":4045,"extent_start":4024,"extent_end":4225,"fully_qualified_name":"Session.Run","ident_utf16":{"start":{"line_number":213,"utf16_col":18},"end":{"line_number":213,"utf16_col":21}},"extent_utf16":{"start":{"line_number":213,"utf16_col":0},"end":{"line_number":225,"utf16_col":1}}},{"name":"tempFile","kind":"function","ident_start":4232,"ident_end":4240,"extent_start":4227,"extent_end":4455,"fully_qualified_name":"tempFile","ident_utf16":{"start":{"line_number":227,"utf16_col":5},"end":{"line_number":227,"utf16_col":13}},"extent_utf16":{"start":{"line_number":227,"utf16_col":0},"end":{"line_number":239,"utf16_col":1}}},{"name":"goRun","kind":"function","ident_start":4462,"ident_end":4467,"extent_start":4457,"extent_end":4646,"fully_qualified_name":"goRun","ident_utf16":{"start":{"line_number":241,"utf16_col":5},"end":{"line_number":241,"utf16_col":10}},"extent_utf16":{"start":{"line_number":241,"utf16_col":0},"end":{"line_number":249,"utf16_col":1}}},{"name":"evalExpr","kind":"method","ident_start":4666,"ident_end":4674,"extent_start":4648,"extent_end":4942,"fully_qualified_name":"Session.evalExpr","ident_utf16":{"start":{"line_number":251,"utf16_col":18},"end":{"line_number":251,"utf16_col":26}},"extent_utf16":{"start":{"line_number":251,"utf16_col":0},"end":{"line_number":267,"utf16_col":1}}},{"name":"isNamedIdent","kind":"function","ident_start":4949,"ident_end":4961,"extent_start":4944,"extent_end":5063,"fully_qualified_name":"isNamedIdent","ident_utf16":{"start":{"line_number":269,"utf16_col":5},"end":{"line_number":269,"utf16_col":17}},"extent_utf16":{"start":{"line_number":269,"utf16_col":0},"end":{"line_number":272,"utf16_col":1}}},{"name":"evalStmt","kind":"method","ident_start":5083,"ident_end":5091,"extent_start":5065,"extent_end":5880,"fully_qualified_name":"Session.evalStmt","ident_utf16":{"start":{"line_number":274,"utf16_col":18},"end":{"line_number":274,"utf16_col":26}},"extent_utf16":{"start":{"line_number":274,"utf16_col":0},"end":{"line_number":309,"utf16_col":1}}},{"name":"appendStatements","kind":"method","ident_start":5900,"ident_end":5916,"extent_start":5882,"extent_end":5992,"fully_qualified_name":"Session.appendStatements","ident_utf16":{"start":{"line_number":311,"utf16_col":18},"end":{"line_number":311,"utf16_col":34}},"extent_utf16":{"start":{"line_number":311,"utf16_col":0},"end":{"line_number":313,"utf16_col":1}}},{"name":"Error","kind":"type","ident_start":5999,"ident_end":6004,"extent_start":5994,"extent_end":6011,"fully_qualified_name":"Error","ident_utf16":{"start":{"line_number":315,"utf16_col":5},"end":{"line_number":315,"utf16_col":10}},"extent_utf16":{"start":{"line_number":315,"utf16_col":0},"end":{"line_number":315,"utf16_col":17}}},{"name":"ErrContinue","kind":"constant","ident_start":6022,"ident_end":6033,"extent_start":6042,"extent_end":6060,"fully_qualified_name":"ErrContinue","ident_utf16":{"start":{"line_number":318,"utf16_col":1},"end":{"line_number":318,"utf16_col":12}},"extent_utf16":{"start":{"line_number":318,"utf16_col":21},"end":{"line_number":318,"utf16_col":39}}},{"name":"Error","kind":"method","ident_start":6079,"ident_end":6084,"extent_start":6064,"extent_end":6115,"fully_qualified_name":"Error.Error","ident_utf16":{"start":{"line_number":321,"utf16_col":15},"end":{"line_number":321,"utf16_col":20}},"extent_utf16":{"start":{"line_number":321,"utf16_col":0},"end":{"line_number":323,"utf16_col":1}}},{"name":"source","kind":"method","ident_start":6135,"ident_end":6141,"extent_start":6117,"extent_end":6480,"fully_qualified_name":"Session.source","ident_utf16":{"start":{"line_number":325,"utf16_col":18},"end":{"line_number":325,"utf16_col":24}},"extent_utf16":{"start":{"line_number":325,"utf16_col":0},"end":{"line_number":343,"utf16_col":1}}},{"name":"Eval","kind":"method","ident_start":6500,"ident_end":6504,"extent_start":6482,"extent_end":7624,"fully_qualified_name":"Session.Eval","ident_utf16":{"start":{"line_number":345,"utf16_col":18},"end":{"line_number":345,"utf16_col":22}},"extent_utf16":{"start":{"line_number":345,"utf16_col":0},"end":{"line_number":404,"utf16_col":1}}},{"name":"storeMainBody","kind":"method","ident_start":7777,"ident_end":7790,"extent_start":7759,"extent_end":7839,"fully_qualified_name":"Session.storeMainBody","ident_utf16":{"start":{"line_number":408,"utf16_col":18},"end":{"line_number":408,"utf16_col":31}},"extent_utf16":{"start":{"line_number":408,"utf16_col":0},"end":{"line_number":410,"utf16_col":1}}},{"name":"restoreMainBody","kind":"method","ident_start":7859,"ident_end":7874,"extent_start":7841,"extent_end":7937,"fully_qualified_name":"Session.restoreMainBody","ident_utf16":{"start":{"line_number":412,"utf16_col":18},"end":{"line_number":412,"utf16_col":33}},"extent_utf16":{"start":{"line_number":412,"utf16_col":0},"end":{"line_number":414,"utf16_col":1}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/morika-t/gore/branches":{"post":"lfyQ5rktBTVIogw9TIrSldjijxh3YxRzip9k9vbPGk0QTZl1i9-4oXJyP7C6EX8oJ5x0yjg_AZILXGUxcJ3PFw"},"/repos/preferences":{"post":"fFFlIdfT3lPL-Kn2Ujqao7RGhQt3NFaQv7R_QlpEpxyJtZX9pQcCPF-joWSLlb4G-2t3mql-yjVmUMB-fjZq4Q"}}},"title":"gore/main.go at master · morika-t/gore","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0