ref: f89245a16fc6ef793b0f35781dd397c58cdd66a6
parent: b675a55ef9e579dcfbf3a22315ede0502925f583
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed May 17 22:50:53 EDT 2023
turn symchar into a define
--- a/flisp.c
+++ b/flisp.c
@@ -345,8 +345,6 @@
// print ----------------------------------------------------------------------
//static int isnumtok(char *tok, value_t *pval);
-//static inline int symchar(char c);
-extern inline int symchar(char c);
//#include "print.c"
--- a/read.c
+++ b/read.c
@@ -84,18 +84,6 @@
#define F value2c(ios_t*, readstate->source)
-// defines which characters are ordinary symbol characters.
-// exceptions are '.', which is an ordinary symbol character
-// unless it's the only character in the symbol, and '#', which is
-// an ordinary symbol character unless it's the first character.
-//inline int
-//symchar(char c)
-//{
-// //static char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
-// char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
-// return !strchr(special, c);
-//}
-
int
isnumtok_base(char *tok, value_t *pval, int base)
{
--- a/read.h
+++ b/read.h
@@ -9,13 +9,8 @@
// exceptions are '.', which is an ordinary symbol character
// unless it's the only character in the symbol, and '#', which is
// an ordinary symbol character unless it's the first character.
-inline int
-symchar(char c)
-{
- //static char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
- char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
- return !strchr(special, c);
-}
+#define symchar(c) (!strchr(symspecials, (c)))
+static char symspecials[] = "()[]'\";`,\\| \a\b\f\n\r\t\v";
#endif