mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-14 05:26:36 +03:00
Fix TLParser not stripping inline comments
This commit is contained in:
parent
9046b46fcd
commit
d515ede7da
|
@ -17,11 +17,13 @@ class TLParser:
|
||||||
|
|
||||||
# Read all the lines from the .tl file
|
# Read all the lines from the .tl file
|
||||||
for line in file:
|
for line in file:
|
||||||
|
# Strip comments from the line
|
||||||
|
comment_index = line.find('//')
|
||||||
|
if comment_index != -1:
|
||||||
|
line = line[:comment_index]
|
||||||
|
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
if line:
|
||||||
# Ensure that the line is not a comment
|
|
||||||
if line and not line.startswith('//'):
|
|
||||||
|
|
||||||
# Check whether the line is a type change
|
# Check whether the line is a type change
|
||||||
# (types <-> functions) or not
|
# (types <-> functions) or not
|
||||||
match = re.match('---(\w+)---', line)
|
match = re.match('---(\w+)---', line)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user