Skip to content

Commit 756f9cd

Browse files
committed
fix: assign yyinput to c
1 parent 21393f9 commit 756f9cd

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

cross_ref/scanner.lpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,8 @@ L?\"([^"\\]|\\['"?\\abfnrtv]|\\[0-7]{1,3}|\\[Xx][0-9a-fA-F]+|{UCN})*\"
139139

140140
void yy::Scanner::handle_inc_file()
141141
{
142-
143142
int c{};
144-
while ((c = yyinput() && c != '\n'))
143+
while ((c = yyinput()) && c != '\n')
145144
;
146145
enter_file(YYText());
147146
BEGIN(INITIAL);

inc_finder/scanner.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace yy
2121
bool exit_file();
2222

2323
private:
24-
int handle_inc_file();
24+
void handle_inc_file();
2525

2626
private:
2727
std::stack<std::ifstream> files;

inc_finder/scanner.lpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using namespace yy;
1919

2020
%%
2121

22-
^"#"[ \t]*include[ \t]*[\"<] { BEGIN(IFILE); }
22+
^"#"[ \t]*include[ \t]*[\"<] { BEGIN(IFILE); }
2323

2424
<IFILE>[^ \t\n\">]+ { handle_inc_file(); }
2525

@@ -34,18 +34,13 @@ using namespace yy;
3434

3535
%%
3636

37-
int yy::Scanner::handle_inc_file()
37+
void yy::Scanner::handle_inc_file()
3838
{
39-
4039
int c{};
41-
while ((c = yyinput() && c != '\n'))
40+
while ((c = yyinput()) && c != '\n')
4241
;
43-
if (!enter_file(YYText()))
44-
{
45-
yyterminate();
46-
}
42+
enter_file(YYText());
4743
BEGIN(INITIAL);
48-
return 0;
4944
}
5045

5146
bool yy::Scanner::enter_file(std::string_view filename)

0 commit comments

Comments
 (0)