Skip to content

Commit 7d1f503

Browse files
committed
Symbol_table is no longer a submodule of Parser.
1 parent 32df796 commit 7d1f503

File tree

7 files changed

+18
-27
lines changed

7 files changed

+18
-27
lines changed

src/bash_compile.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ open Core.Std
22
open Bash_ast
33

44
module BAST = Batsh_ast
5-
module Symbol_table = Parser.Symbol_table
65

76
let is_arith (expr: BAST.expression) :bool =
87
match expr with

src/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ let ast =
9595
let ast_sexp = Batsh_ast.sexp_of_t ast in
9696
printf "%a\n" Sexp.output_hum ast_sexp
9797
else
98-
let symtable_sexp = Parser.Symbol_table.sexp_of_t (Parser.symtable batsh) in
98+
let symtable_sexp = Symbol_table.sexp_of_t (Parser.symtable batsh) in
9999
printf "%a\n" Sexp.output_hum symtable_sexp
100100
)
101101

src/parser.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ let parse (lexbuf : Lexing.lexbuf) : Batsh_ast.t =
2626
let err = sprintf "%a: syntax error" print_position () in
2727
raise (ParseError err)
2828

29-
module Symbol_table = struct
30-
include Symbol_table
31-
end
32-
3329
let create_from_lexbuf (lexbuf : Lexing.lexbuf) (filename: string) : t =
3430
lexbuf.Lexing.lex_curr_p <- {
3531
lexbuf.Lexing.lex_curr_p with Lexing.pos_fname = filename

src/parser.mli

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
open Core.Std
2-
31
type t
42
exception ParseError of string
53

6-
module Symbol_table : sig
7-
type t
8-
module Scope : sig
9-
type t
10-
val is_function : t -> bool
11-
val is_global_variable : t -> name: string -> bool
12-
val add_temporary_variable : t -> Batsh_ast.identifier
13-
val fold : t -> init: 'a -> f: (string -> bool -> 'a -> 'a) -> 'a
14-
end
15-
val scope : t -> string -> Scope.t
16-
val global_scope : t -> Scope.t
17-
val sexp_of_t : t -> Sexp.t
18-
val is_function : t -> string -> bool
19-
end
20-
214
val create_from_file : string -> t
225
val create_from_channel : in_channel -> string -> t
236
val create_from_string : string -> t

src/symbol_table.mli

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
open Core.Std
2+
3+
type t
4+
5+
module Scope : sig
6+
type t
7+
val is_function : t -> bool
8+
val is_global_variable : t -> name: string -> bool
9+
val add_temporary_variable : t -> Batsh_ast.identifier
10+
val fold : t -> init: 'a -> f: (string -> bool -> 'a -> 'a) -> 'a
11+
end
12+
13+
val create : Batsh_ast.t -> t
14+
val scope : t -> string -> Scope.t
15+
val global_scope : t -> Scope.t
16+
val sexp_of_t : t -> Sexp.t
17+
val is_function : t -> string -> bool

src/winbat_compile.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ open Core.Std
22
open Batsh_ast
33
open Winbat_ast
44

5-
module Symbol_table = Parser.Symbol_table
6-
75
let rec compile_leftvalue
86
(lvalue: Batsh_ast.leftvalue)
97
~(symtable: Symbol_table.t)

src/winbat_transform.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
open Core.Std
22
open Batsh_ast
33

4-
module Symbol_table = Parser.Symbol_table
5-
64
let rec split_expression
75
?(no_split_top = false)
86
?(split_call = true)

0 commit comments

Comments
 (0)