🔨 clean up

This commit is contained in:
Niels Lohmann 2020-06-22 08:59:03 +02:00
parent e22ce45065
commit 65e8ee985a
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
4 changed files with 48 additions and 44 deletions

View file

@ -1489,6 +1489,15 @@ scan_number_done:
return true;
}
void skip_whitespace()
{
do
{
get();
}
while (current == ' ' or current == '\t' or current == '\n' or current == '\r');
}
token_type scan()
{
// initially, skip the BOM
@ -1499,11 +1508,7 @@ scan_number_done:
}
// read next character and ignore whitespace
do
{
get();
}
while (current == ' ' or current == '\t' or current == '\n' or current == '\r');
skip_whitespace();
// ignore comments
if (ignore_comments and current == '/')
@ -1514,11 +1519,7 @@ scan_number_done:
}
// skip following whitespace
do
{
get();
}
while (current == ' ' or current == '\t' or current == '\n' or current == '\r');
skip_whitespace();
}
switch (current)