summaryrefslogtreecommitdiff
path: root/DevTools/IPCCompiler
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-03 21:29:09 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-03 21:29:09 +0200
commit3100e8dee520b7c988d36b38b76b95a0ee9b8e7c (patch)
treec8d17eca0e9536bb7562c134ee6c29862f018de2 /DevTools/IPCCompiler
parent0f0b00dc1f56dbd380c989b3de8a3b5253efbb5f (diff)
downloadserenity-3100e8dee520b7c988d36b38b76b95a0ee9b8e7c.zip
IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintions
Diffstat (limited to 'DevTools/IPCCompiler')
-rw-r--r--DevTools/IPCCompiler/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/DevTools/IPCCompiler/main.cpp b/DevTools/IPCCompiler/main.cpp
index 37b927b47f..3093b9af7d 100644
--- a/DevTools/IPCCompiler/main.cpp
+++ b/DevTools/IPCCompiler/main.cpp
@@ -51,9 +51,9 @@ int main(int argc, char** argv)
int index = 0;
- auto peek = [&]() -> char {
- if (index < file_contents.size())
- return file_contents[index];
+ auto peek = [&](int offset = 0) -> char {
+ if ((index + offset) < file_contents.size())
+ return file_contents[index + offset];
return 0;
};
@@ -85,6 +85,10 @@ int main(int argc, char** argv)
auto consume_whitespace = [&] {
while (isspace(peek()))
++index;
+ if (peek() == '/' && peek(1) == '/') {
+ while (peek() != '\n')
+ ++index;
+ }
};
auto parse_parameter = [&](Vector<Parameter>& storage) {