Skip to content

Commit 66dba8f

Browse files
committed
split token on colon
Reference: #4229 Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
1 parent 4b57a7f commit 66dba8f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cluecode/copyrights.py

+10
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,16 @@ def get_tokens(numbered_lines, splitter=re.compile(r'[\t =;]+').split):
436436
.rstrip(':') # strip trailing colons
437437
.strip()
438438
)
439+
440+
# Split tokens like 'Author:Frankie.Chu' into 'Author' and 'Frankie.Chu'
441+
if tok.startswith("Author:"):
442+
parts = tok.split(":", 1)
443+
for part in parts:
444+
part = part.strip()
445+
if part and part not in ':.':
446+
yield Token(value=part, start_line=start_line, pos=pos)
447+
pos += 1
448+
continue
439449

440450
# the tokenizer allows a single colon or dot to be a token and we discard these
441451
if tok and tok not in ':.':

0 commit comments

Comments
 (0)