<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tokenize_number(val, line):
 """Parse val correctly into int or float."""

    try:
        num = int(val)
        typ = TokenType.int
    except ValueError:
        num = float(val)
        typ = TokenType.float

    return {'type': typ, 'value': num, 'line': line}