From 25bfdfc24e4ff95590d15bfbfa981710a737f08e Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 28 Mar 2021 19:49:37 +0200 Subject: [PATCH] Moved `isCharacterNumber` to utils.d --- source/tlang/compiler/symbols.d | 8 -------- source/tlang/misc/utils.d | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/tlang/compiler/symbols.d b/source/tlang/compiler/symbols.d index e426a51..0d615e1 100644 --- a/source/tlang/compiler/symbols.d +++ b/source/tlang/compiler/symbols.d @@ -69,14 +69,6 @@ public bool isType(string tokenStr) "long") == 0 || cmp(tokenStr, "ulong") == 0 || cmp(tokenStr, "void") == 0; } -/** -* Checks if the given character is a number -*/ -private bool isCharacterNumber(char character) -{ - return (character >= 48 && character <= 57); -} - private bool isIdentifier(string token) { /* This is used to prevent the first character from not being number */ diff --git a/source/tlang/misc/utils.d b/source/tlang/misc/utils.d index d069a9f..1b19bb0 100644 --- a/source/tlang/misc/utils.d +++ b/source/tlang/misc/utils.d @@ -21,4 +21,12 @@ public bool isPresent(string[] arr, string t) public bool isCharacterAlpha(char character) { return (character >= 65 && character <= 90) || (character >= 97 && character <= 122); +} + +/** +* Checks if the given character is a number +*/ +public bool isCharacterNumber(char character) +{ + return (character >= 48 && character <= 57); } \ No newline at end of file