Esempio n. 1
0
def make_source_location(*, fixed: bool = False) -> SourceLocation:
    line = make_pos_int_value(fixed=fixed)
    column = make_pos_int_value(fixed=fixed)
    str_value = make_str_value(fixed=fixed)
    source = f"file_{str_value}.py"

    return SourceLocation(line=line, column=column, source=source)
Esempio n. 2
0
def make_source_location(fixed: bool = False) -> SourceLocation:
    factories = Factories if fixed else RandomFactories
    line = factories.make_pos_int()
    column = factories.make_pos_int()
    str_value = factories.make_str()
    source = f"file_{str_value}.py"

    return SourceLocation(line=line, column=column, source=source)
Esempio n. 3
0
def make_invalid_location_node(fixed: bool = False) -> LocationNode:
    return LocationNode(loc=SourceLocation(line=0, column=-1, source="<str>"))