More work on getting parsing to be functional
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
// AUTOGENERATED COPYRIGHT HEADER START
|
||||
// Copyright (C) 2025 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||
// AUTOGENERATED COPYRIGHT HEADER END
|
||||
#include "util.hpp"
|
||||
#include <cctype>
|
||||
|
||||
bool blitz::utility::is_symbol(int code)
|
||||
{
|
||||
switch (chr) {
|
||||
case ';': // Comment
|
||||
case ':': // Command Separator
|
||||
case '=': // Equal
|
||||
case '<': // Less Than
|
||||
case '>': // Greater Than
|
||||
case '~': // Bitwise Not
|
||||
case '^': // Exponential (X ^ Y = pow(X, Y))
|
||||
case '+': // Plus
|
||||
case '-': // Minus
|
||||
case '*': // Multiply
|
||||
case '/': // Divide
|
||||
case ',': // Parameter Separation
|
||||
case '%': // Integer Type
|
||||
case '#': // Real Type
|
||||
case '$': // String Type
|
||||
case '.': // Structured Type
|
||||
case '\\': // Structured Type Access
|
||||
|
||||
case '[': // Blitz Arrays
|
||||
case ']':
|
||||
|
||||
case '(': // Call, Grouping, Dim
|
||||
case ')':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool blitz::utility::is_white_space(int code)
|
||||
{
|
||||
switch (chr) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool blitz::utility::is_digit(int code)
|
||||
{
|
||||
return isdigit(code);
|
||||
}
|
||||
|
||||
bool blitz::utility::is_alpha(int code) {
|
||||
return isalpha(code);
|
||||
}
|
||||
Reference in New Issue
Block a user