Skip to content

Commit

Permalink
Fix bug related to (line, col)-setting when the program contains comm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
adrian13579 committed Feb 28, 2021
1 parent 14d9505 commit 62b1426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lexing/lexing_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def t_aux_rcomment(t):
t.value = t.lexer.lexdata[t.lexer.comm_start:t.lexer.lexpos]
t.type = "COMMENT"
t.lexer.lineno += t.value.count('\n')
t.lexer.col = len(t.value) - t.value.rfind('\n')
t.lexer.begin('INITIAL')
# return t

Expand Down Expand Up @@ -270,5 +271,5 @@ def t_ANY_error(t):


# TODO: Add separate tokens for class (types) names and identifiers
# TODO: Fix bug related to (line, col)-setting when program contains comments
# TODO: Fix bug related to (line, col)-setting when the program contains comments
# TODO: Handle errors inside comments (unbalanced multiline comments delimeters)

0 comments on commit 62b1426

Please sign in to comment.