Hayden Hargreaves 39186fad50 (FEAT): Worked on the parser class definition.
There are no implementations yet, just a rough outline and some
comments.

This commit also includes an update to the Makefile to use wild cards
to build the `libs`, which will solve the issue with dynamic updating.
2025-10-14 13:07:55 -07:00

25 lines
547 B
C++

#include "./util.h"
void removeTrailingWhitespace(std::string &input) {
size_t start = input.find_first_not_of(" \t\n\r\f\v");
if (start != std::string::npos) {
input.erase(0, start);
} else {
input.clear();
}
}
void removeLeadingWhitespace(std::string &input) {
size_t end = input.find_last_not_of(" \t\n\r\f\v");
if (end != std::string::npos) {
input.erase(end + 1);
} else {
input.clear();
}
}
void removeWhitespace(std::string &input) {
removeLeadingWhitespace(input);
removeTrailingWhitespace(input);
}