mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-05-14 01:22:06 +00:00
refactor: Syntax with unit tests
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
open Expressions
|
||||
|
||||
type statements =
|
||||
| SequenceStatement of statements * statements
|
||||
| ExpressionStatement of expressions
|
||||
|
||||
let rec pp_statements = function
|
||||
| SequenceStatement (stmt1, stmt2) ->
|
||||
let pp_stmt1 = pp_statements stmt1 and pp_stmt2 = pp_statements stmt2 in
|
||||
Printf.sprintf "SequenceStatement(%s, %s)" pp_stmt1 pp_stmt2
|
||||
| ExpressionStatement expr ->
|
||||
let pp_expr = pp_expressions expr in
|
||||
Printf.sprintf "ExpressionStatement(%s)" pp_expr
|
||||
Reference in New Issue
Block a user