parser

package
v0.13.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package parser provides in-memory Tree-sitter parsing for the merge pipeline. It is a thin wrapper around astkit's parser engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLanguage

func DetectLanguage(path, content string) core.LanguageKey

DetectLanguage returns the language key for path.

func IsAST

func IsAST(lang core.LanguageKey) bool

IsAST reports whether the language is parsed via tree-sitter.

func IsConfig

func IsConfig(lang core.LanguageKey) bool

IsConfig reports whether the language is a config/data format handled by the deep-merge strategy.

func Supported

func Supported(lang core.LanguageKey) bool

Supported reports whether Fuse can merge files of this language at all.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine wraps astkit's parser engine for Fuse's in-memory three-way merge.

func NewEngine

func NewEngine() *Engine

func (*Engine) Parse

func (e *Engine) Parse(lang core.LanguageKey, src []byte) (*sitter.Tree, error)

Parse parses src under the given language and returns a tree-sitter tree (caller must Close it) or nil for non-AST languages (JSON/YAML/TOML).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL