OCaml: Add simulate (dry run) configuration option

This commit is contained in:
Juno Takano 2025-05-17 00:48:49 -03:00
commit 9e9a9566db
5 changed files with 42 additions and 25 deletions

View file

@ -21,6 +21,8 @@ let lex_keyword (literal: string): token =
match literal with
| "su_command" -> Key SuCommand
| "su_command_quoted" -> Key SuCommandQuoted
| "interactive" -> Key Interactive
| "simulate" -> Key Simulate
| _ -> Key Unknown
let lex_keyvalue (literal: string): token = Value literal
@ -31,6 +33,7 @@ let string_of_token (token: token): string =
| SuCommand -> "[ KEY: su_command ]"
| SuCommandQuoted -> "[ KEY: su_command_quoted ]"
| Interactive -> " [ KEY: interactive ]"
| Simulate -> " [ KEY: simulate ]"
| Unknown -> "[ UNKNOWN KEY ]")
| Equal -> "[ OP: equal ]"
| Value v -> "[ VAL: " ^ v ^ " ]"