mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 06:32:54 +00:00
IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintions
This commit is contained in:
parent
0f0b00dc1f
commit
3100e8dee5
Notes:
sideshowbarker
2024-07-19 12:54:46 +09:00
Author: https://github.com/awesomekling
Commit: 3100e8dee5
2 changed files with 10 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue