Minimal SQLite key-value store for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add mli files for internal ast and lexer modules (E505)

+38
+28
lib/ast.mli
··· 1 + (** SQLite CREATE TABLE AST types and column classification. *) 2 + 3 + type col_token = 4 + | Tok_word of string 5 + | Tok_number of string 6 + | Tok_parens of col_token list 7 + 8 + type table_constraint = 9 + | Tbl_unique of string list 10 + | Tbl_primary_key of string list 11 + | Tbl_other 12 + 13 + type column_def = { 14 + name : string; 15 + affinity : string; 16 + is_rowid_alias : bool; 17 + has_unique : bool; 18 + } 19 + 20 + type create_table = { 21 + tbl_name : string; 22 + columns : column_def list; 23 + table_constraints : table_constraint list; 24 + } 25 + 26 + val classify_column : string -> col_token list -> column_def 27 + (** [classify_column name tokens] splits [tokens] into type affinity and 28 + constraints, returning a column definition. *)
+10
lib/lexer.mli
··· 1 + (** Sedlex lexer for SQLite CREATE TABLE statements. *) 2 + 3 + exception Error of string 4 + (** Raised on lexer errors (unterminated strings, unexpected input). *) 5 + 6 + val token : Sedlexing.lexbuf -> Parser.token 7 + (** [token lexbuf] returns the next token. *) 8 + 9 + val parse : string -> (Ast.create_table, string) result 10 + (** [parse sql] parses a CREATE TABLE statement. *)