Skip to content

Commit 9e098a5

Browse files
Fix issue with comment after a multiline statement in single line.
Co-authored-by: Thirumalai Shaktivel <Thirumalai-Shaktivel@users.noreply.github.com>
1 parent 8499cee commit 9e098a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lpython/parser/parser.yy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,11 @@ statements1
326326

327327
single_line_statements
328328
: single_line_multi_statements TK_NEWLINE { $$ = $1; }
329-
| single_line_multi_statements TK_COMMENT TK_NEWLINE { $$ = $1; }
329+
| single_line_multi_statements TK_EOLCOMMENT { $$ = $1; }
330330
| single_line_statement TK_NEWLINE { $$ = A2LIST(p.m_a, $1); }
331331
| single_line_statement TK_SEMICOLON TK_NEWLINE { $$ = A2LIST(p.m_a, $1); }
332-
| single_line_statement TK_SEMICOLON TK_COMMENT TK_NEWLINE { $$ = A2LIST(p.m_a, $1); }
333-
| single_line_statement TK_COMMENT TK_NEWLINE { $$ = A2LIST(p.m_a, $1); }
332+
| single_line_statement TK_SEMICOLON TK_EOLCOMMENT { $$ = A2LIST(p.m_a, $1); }
333+
| single_line_statement TK_EOLCOMMENT { $$ = A2LIST(p.m_a, $1); }
334334
;
335335

336336
single_line_multi_statements

0 commit comments

Comments
 (0)