language-go-0.9: A library for analysis and synthesis of Go code.

Safe HaskellSafe-Inferred

Language.Go.Parser.Tokens

Contents

Description

This module defines Go tokens and the parser type. It also defines various utility functions for the lexer and parser.

Synopsis

Parser

type GoParser a = GenParser GoTokenPos GoParserState aSource

GoParser is the type used for all parsers

Tokens and utilities for lexer

data GoTokenPos Source

GoTokenPos encodes tokens and source positions

Constructors

GoTokenPos !SourcePos !GoToken 

insertSemi :: [GoTokenPos] -> [GoTokenPos]Source

insertSemi performs semicolon insertion.

tokenFromChar :: String -> GoTokenSource

tokenFromChar c unquotes the Go representation of a single character literal, including the single quotes.

Parsers for elementary punctuation

goAssignOp :: GoParser GoOpSource

Standard assign_op

See also: SS. 11.6. Assignments

Parsers for keywords