meta: replace bluelib with fx
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
#include <blue/cmd.h>
|
||||
#include <fx/cmd.h>
|
||||
#include "cmd.h"
|
||||
#include <ivy/lang/lex.h>
|
||||
#include <ivy/lang/internal.h>
|
||||
#include <blue/term.h>
|
||||
#include <fx/term.h>
|
||||
|
||||
enum {
|
||||
OPT_PRINT_SYMBOLS = 0x1000,
|
||||
OPT_PRINT_KEYWORDS,
|
||||
};
|
||||
|
||||
static int internal(const b_command *cmd, const b_arglist *args, const b_array *_)
|
||||
static int internal(const fx_command *cmd, const fx_arglist *args, const fx_array *_)
|
||||
{
|
||||
struct ivy_lexer *lex;
|
||||
enum ivy_status status = ivy_lexer_create(&lex);
|
||||
|
||||
if (status != IVY_OK) {
|
||||
b_err("failed to initialise lexer (error %s)",
|
||||
fx_err("failed to initialise lexer (error %s)",
|
||||
ivy_status_to_string(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (b_arglist_get_count(args, OPT_PRINT_SYMBOLS, B_COMMAND_INVALID_ID)) {
|
||||
if (fx_arglist_get_count(args, OPT_PRINT_SYMBOLS, FX_COMMAND_INVALID_ID)) {
|
||||
internal_lexer_print_symbol_tree(lex);
|
||||
}
|
||||
|
||||
if (b_arglist_get_count(args, OPT_PRINT_KEYWORDS, B_COMMAND_INVALID_ID)) {
|
||||
if (fx_arglist_get_count(args, OPT_PRINT_KEYWORDS, FX_COMMAND_INVALID_ID)) {
|
||||
internal_lexer_print_keyword_dict(lex);
|
||||
}
|
||||
|
||||
@@ -35,26 +35,26 @@ static int internal(const b_command *cmd, const b_arglist *args, const b_array *
|
||||
|
||||
B_COMMAND(CMD_INTERNAL, CMD_ROOT)
|
||||
{
|
||||
B_COMMAND_NAME("internal");
|
||||
B_COMMAND_SHORT_NAME('X');
|
||||
B_COMMAND_DESC("internal frontend debugging tools.");
|
||||
B_COMMAND_FUNCTION(internal);
|
||||
FX_COMMAND_NAME("internal");
|
||||
FX_COMMAND_SHORT_NAME('X');
|
||||
FX_COMMAND_DESC("internal frontend debugging tools.");
|
||||
FX_COMMAND_FUNCTION(internal);
|
||||
|
||||
B_COMMAND_OPTION(OPT_PRINT_SYMBOLS)
|
||||
FX_COMMAND_OPTION(OPT_PRINT_SYMBOLS)
|
||||
{
|
||||
B_OPTION_LONG_NAME("print-symbols");
|
||||
B_OPTION_SHORT_NAME('s');
|
||||
B_OPTION_DESC(
|
||||
FX_OPTION_LONG_NAME("print-symbols");
|
||||
FX_OPTION_SHORT_NAME('s');
|
||||
FX_OPTION_DESC(
|
||||
"print the symbol tree used by the language lexer.");
|
||||
}
|
||||
|
||||
B_COMMAND_OPTION(OPT_PRINT_KEYWORDS)
|
||||
FX_COMMAND_OPTION(OPT_PRINT_KEYWORDS)
|
||||
{
|
||||
B_OPTION_LONG_NAME("print-keywords");
|
||||
B_OPTION_SHORT_NAME('k');
|
||||
B_OPTION_DESC(
|
||||
FX_OPTION_LONG_NAME("print-keywords");
|
||||
FX_OPTION_SHORT_NAME('k');
|
||||
FX_OPTION_DESC(
|
||||
"print the keyword dictionary used by the language lexer.");
|
||||
}
|
||||
|
||||
B_COMMAND_HELP_OPTION();
|
||||
FX_COMMAND_HELP_OPTION();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user