Skip to content

Commit

Permalink
Purge most unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-byers committed Sep 2, 2024
1 parent 9a8cd00 commit b2e8379
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "hir.h"
#include "map.h"

// All paw language keywords
//
// ORDER TokenKind
static const char *kKeywords[] = {
"pub",
"fn",
Expand Down
24 changes: 24 additions & 0 deletions src/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,44 @@ static int string_ends_with(paw_Env *P)

static int int_to_string(paw_Env *P)
{
<<<<<<< HEAD
Value *pv = CF_BASE(1);
pawV_to_string(P, pv, PAW_TINT, NULL);
=======
const Value v = CF_BASE(1);
pawV_to_string(P, v, PAW_TINT, NULL);
>>>>>>> bd4c908 (Purge most unused code)
return 1;
}

static int string_parse_float(paw_Env *P)
{
<<<<<<< HEAD
paw_Float f;
const char *str = V_TEXT(*CF_BASE(1));
const int status = pawV_parse_float(P, str, &f);
if (status != PAW_OK) pawR_error(P, PAW_ESYNTAX, "invalid float '%s'", str);
V_SET_FLOAT(CF_BASE(1), f);
=======
const char *str = V_TEXT(CF_BASE(1));
const int rc = pawV_parse_float(P, str);
if (rc != PAW_OK) {
pawR_error(P, PAW_ESYNTAX, "invalid float '%s'", str);
}
>>>>>>> bd4c908 (Purge most unused code)
return 1;
}

static int string_parse_int(paw_Env *P)
{
<<<<<<< HEAD
const char *str = V_TEXT(*CF_BASE(1));
const paw_Int base = V_INT(*CF_BASE(2));
=======
const char *str = V_TEXT(CF_BASE(1));
const paw_Int base = V_INT(CF_BASE(2));
pawC_pop(P);
>>>>>>> bd4c908 (Purge most unused code)

paw_Int i;
const int rc = pawV_parse_int(P, str, base, &i);
Expand All @@ -251,8 +270,13 @@ static int map_get(paw_Env *P)

static int map_erase(paw_Env *P)
{
<<<<<<< HEAD
Map *m = V_MAP(*CF_BASE(1));
pawH_erase(m, *CF_BASE(2));
=======
Map *m = V_MAP(CF_BASE(1));
pawH_erase(m, CF_BASE(2));
>>>>>>> bd4c908 (Purge most unused code)
return 0;
}

Expand Down
3 changes: 0 additions & 3 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,9 +1418,6 @@ static void load_prelude(struct Lex *lex)
check(lex, TK_END);
}

// All paw language keywords
//
// ORDER TokenKind
static void skip_hashbang(struct Lex *lex)
{
if (test_next(lex, '#') && test_next(lex, '!')) {
Expand Down

0 comments on commit b2e8379

Please sign in to comment.