// this function is called when the cursor is at the '.' and you need to get the
// declaration before that dot
964065
func (c *auto_complete_context) deduce_cursor_decl(iter *token_iterator) (*decl, ast.Expr) {
	expr, err := parser.ParseExpr(iter.extract_go_expr())
	if err != nil {
		return nil, nil
	}
	return expr_to_decl(expr, c.current.scope), expr
}
1299362
func (ln *line) isDeclaration() bool {
	_, _, err := declarationPV(ln)
	return err == nil
}
516355
func (i *FuncInterceptor) BeforeDecision(decision *swf.PollForDecisionTaskOutput, ctx *FSMContext, outcome *Outcome) {
	if i.BeforeDecisionFn != nil {
		i.BeforeDecisionFn(decision, ctx, outcome)
	}
}
1129504
func (t *Tabulate) getAlignFunc() func(int, string) string {
	if len(t.Align) < 1 || t.Align == "right" {
		return t.padLeft
	} else if t.Align == "left" {
		return t.padRight
	} else {
		return t.padCenter
	}
}
606626
func (s *Statement) Dot(name string) *Statement {
	d := token{
		typ:     delimiterToken,
		content: ".",
	}
	t := token{
		typ:     identifierToken,
		content: name,
	}
	*s = append(*s, d, t)
	return s
}
1124915
func (k cursorKind) fetchPrevCursor(c context.Context, pkg, cursor string) string {
	itm, err := memcache.GetKey(c, k.cursorKey(pkg, cursor))
	if err != nil {
		if err != memcache.ErrCacheMiss {
			logging.WithError(err).Errorf(c, "Failed to fetch prev cursor %q from memcache", k)
		}
		return ""
	}
	return string(itm.Value())
}
175624
func (d *Document) GetCursorLeftPosition(count int) int {
	if count < 0 {
		return d.GetCursorRightPosition(-count)
	}
	if d.CursorPositionCol() > count {
		return -count
	}
	return -d.CursorPositionCol()
}
1060632
func (c *cursor) Prev() (key, value []byte) {
	return (*bbolt.Cursor)(c).Prev()
}
9595
func (d *Document) CurrentLineBeforeCursor() string {
	s := strings.Split(d.TextBeforeCursor(), "\n")
	return s[len(s)-1]
}
1110732
func (b *Buffer) CursorLeft(count int) {
	l := b.Document().GetCursorLeftPosition(count)
	b.cursorPosition += l
	return
}
1090536
func NewStyleDeclaration(styleRule *StyleRule, declaration *css.Declaration) *StyleDeclaration {
	return &StyleDeclaration{
		StyleRule:   styleRule,
		Declaration: declaration,
	}
}
368169
func (c *Callbacks) OnCDemoStringTables(fn func(*dota.CDemoStringTables) error) {
	c.onCDemoStringTables = append(c.onCDemoStringTables, fn)
}
35505
func OnTermination(fn TermFunc) {
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt)
	signal.Notify(c, os.Kill)
	signal.Notify(c, syscall.SIGTERM)

	go func() {
		select {
		case <-c:
			if fn != nil {
				fn()
			}
		}
	}()
}
16926
func (c *PrefixCursor) First() ([]byte, []byte) {
	var k, v []byte

	for k, v = c.C.First(); k != nil && !bytes.HasPrefix(k, c.Prefix); k, v = c.C.Next() {
	}

	if k == nil {
		return nil, nil
	}

	if c.Reverse {
		kc, vc := k, v
		for ; kc != nil && bytes.HasPrefix(kc, c.Prefix); kc, vc = c.C.Next() {
			k, v = kc, vc
		}
		if kc != nil {
			k, v = c.C.Prev()
		}
	}

	return k, v
}
240550
func (v *View) Cursor() (x, y int) {
	return v.cx, v.cy
}
631693
func ShowCursor(toggle int) (int, error) {
	i := int(C.SDL_ShowCursor(C.int(toggle)))
	return i, errorFromInt(i)
}
784007
func (d *Document) FindEndOfCurrentWordUntilSeparator(sep string) int {
	if sep == "" {
		return d.FindEndOfCurrentWord()
	}

	x := d.TextAfterCursor()
	i := strings.IndexAny(x, sep)
	if i != -1 {
		return i
	}
	return len(x)
}