mirror of
https://github.com/hazemKrimi/jack-vm-translator.git
synced 2026-05-01 18:00:27 +00:00
feat: line checking utils
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
#include <cctype>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
bool isEmptyLine(std::string line) {
|
||||||
|
for (char c : line) {
|
||||||
|
if (!isspace(c))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isComment(std::string line) { return line[0] == '/' && line[1] == '/'; }
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#include <string>
|
||||||
|
|
||||||
|
bool isEmptyLine(std::string);
|
||||||
|
bool isComment(std::string);
|
||||||
Reference in New Issue
Block a user