FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lexer package - github.com/sqlc-dev/meyer/lexer - Go Packages

  1. Discover Packages
  2. github.com/sqlc-dev/meyer
  3. lexer

lexer

package
v0.1.1 Latest Latest

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 1 Imported by: 0
Main Versions Licenses Imports Imported By

Details

Repository

Links

Documentation

Documentation

Overview

Package lexer implements SQLite's tokenizer.

It is a direct port of sqlite3GetToken() in src/tokenize.c together with the token post-processing sqlite3RunParser() performs around it: runs of whitespace and comments are dropped, and the WINDOW/OVER/FILTER keywords are resolved against their neighbours (analyzeWindowKeyword and friends).

Illegal input is not reported here. sqlite3RunParser aborts at the first TK_ILLEGAL token it reaches, which is exactly as far as the parser had got, so meyer keeps ILLEGAL tokens in the stream and lets the parser report "unrecognized token" when it reaches one. That preserves SQLite's ordering between tokenizer errors and syntax errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lex

func Lex(src string) []token.Token

Lex splits src into tokens. Whitespace and comments are dropped; the returned slice always ends with a single EOF token whose Pos is the end of the consumed input.

A NUL byte terminates the input, matching SQLite, whose tokenizer walks a NUL-terminated buffer.

Types

This section is empty.


Back | FazBrowse Home | New Git URL