shared

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package shared defines types shared by all parser implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AstNode

type AstNode interface {
	// Connect connects this AstNode to another AstNode with the given predicate,
	// and returns the same AstNode.
	Connect(predicate string, other AstNode) AstNode

	// Decorate decorates this AstNode with the given property and string value,
	// and returns the same AstNode.
	Decorate(property string, value string) AstNode

	// DecorateWithInt decorates this AstNode with the given property and int value,
	// and returns the same AstNode.
	DecorateWithInt(property string, value int) AstNode
}

AstNode defines an interface for representing AST nodes constructed by the parser during the parsing process.

type NodeBuilder

type NodeBuilder func(source compilercommon.InputSource, kind sourceshape.NodeType) AstNode

NodeBuilder is a function for building AST nodes.

type ParsedImportType

type ParsedImportType int

ParsedImportType represents the various types of parsed imports.

const (
	// ParsedImportTypeLocal indicates that the import is a local file system import.
	ParsedImportTypeLocal ParsedImportType = iota

	// ParsedImportTypeAlias indicates that the import is an alias to defined library.
	ParsedImportTypeAlias

	// ParsedImportTypeVCS indicates that the import is a VCS import.
	ParsedImportTypeVCS
)

func ParseImportValue

func ParseImportValue(importLiteral string) (string, ParsedImportType, error)

ParseImportValue parses an import literal value into its path and whether it is found under VCS. Returns a tuple of (path, type).

Jump to

Keyboard shortcuts

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