Skip to content

Commit 61f6611

Browse files
committed
Initial AST generation
1 parent 765e549 commit 61f6611

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pylasu/lionweb/ast_generation.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,22 @@
3737
#
3838

3939
@click.command()
40+
@click.argument("dependencies", nargs=-1, type=click.Path(exists=True, dir_okay=False, readable=True))
4041
@click.argument("lionweb-language", type=click.Path(exists=True, dir_okay=False, readable=True))
4142
@click.argument("output", type=click.Path(exists=False, file_okay=False, writable=True))
42-
def main(lionweb_language, output):
43+
def main(dependencies, lionweb_language, output):
4344
"""Simple CLI that processes a file and writes results to a directory."""
4445
serialization = SerializationProvider.get_standard_json_serialization(LionWebVersion.V2023_1)
46+
47+
for dep in dependencies:
48+
click.echo(f"Processing dependency {dep}")
49+
with open(dep, "r", encoding="utf-8") as f:
50+
content = f.read()
51+
language = cast(Language, serialization.deserialize_string_to_nodes(content)[0])
52+
serialization.register_language(language=language)
53+
serialization.classifier_resolver.register_language(language)
54+
serialization.classifier_resolver.resolve_classifier(language)
55+
4556
click.echo(f"📄 Processing file: {lionweb_language}")
4657
with open(lionweb_language, "r", encoding="utf-8") as f:
4758
content = f.read()

0 commit comments

Comments
 (0)