Created
June 8, 2020 23:43
-
-
Save vinniefalco/61f868c0a5de82365ad9e1c6210fbc87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void parse_white_and_comments() | |
{ | |
for(;;) | |
{ | |
maybe_skip_white(); | |
if(*cs != '/') | |
return; | |
++cs; | |
do_wht1: | |
if(! cs) | |
return suspend(state::wht1); | |
if(*cs == '/') | |
{ | |
// C++ comment | |
++cs; | |
do_wht2: | |
if(! skip_to_newline()) | |
return suspend(state::wht2); | |
} | |
else if(*cs == '*') | |
{ | |
// C comment | |
++cs; | |
do_wht3: | |
if(! skip_to_closing_comment()) | |
return suspend(state::wht3); | |
} | |
else | |
{ | |
ec_ = error::bad_comment; | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment