Skip to content

Commit 1b0de7c

Browse files
committed
Update after recent Langkit breaking changes
1 parent 131d0e2 commit 1b0de7c

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

lkql/manage.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#! /usr/bin/env python
22

3+
from langkit.compile_context import CompileCtx
4+
import langkit.config as C
35
from langkit.libmanage import ManageScript
6+
import langkit.names as names
7+
from langkit.utils import PluginLoader
48

59

610
class Manage(ManageScript):
711

812
ENABLE_BUILD_WARNINGS_DEFAULT = True
913

10-
def create_context(self, args):
11-
12-
from langkit.compile_context import CompileCtx
13-
14+
def create_config(self):
15+
return C.CompilationConfig(
16+
lkt=None,
17+
library=C.LibraryConfig(
18+
root_directory=".",
19+
language_name=names.Name("Lkql"),
20+
short_name="lkql",
21+
),
22+
)
23+
24+
def create_context(self, config, verbosity):
1425
from language.lexer import lkql_lexer
1526
from language.parser import lkql_grammar
1627

17-
ctx = CompileCtx(lang_name='Lkql',
18-
short_name='lkql',
19-
lexer=lkql_lexer,
20-
grammar=lkql_grammar)
21-
22-
return ctx
28+
return CompileCtx(
29+
config=config,
30+
plugin_loader=PluginLoader(config.library.root_directory),
31+
lexer=lkql_lexer,
32+
grammar=lkql_grammar,
33+
verbosity=verbosity,
34+
)
2335

2436

2537
if __name__ == '__main__':

0 commit comments

Comments
 (0)