Skip to content

Commit 0ce1da4

Browse files
authored
Merge pull request #521 from EvgSkv/dev
Adding C++ parser.
2 parents 6f0b5ac + 68f7a41 commit 0ce1da4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/scripts/setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
long_description_content_type = "text/markdown",
3434
url="https://github.com/evgskv/logica",
3535
packages=setuptools.find_namespace_packages(),
36+
package_data={
37+
# The release script clones the repo into a `logica/` folder and builds a
38+
# namespace package, so this package is named `logica.parser_cpp`.
39+
# Ship the C++ source so the runtime bridge can build liblogica_parse_cpp.so.
40+
'logica.parser_cpp': ['logica_parse.cpp'],
41+
},
3642
classifiers = [
3743
"Topic :: Database",
3844
"License :: OSI Approved :: Apache Software License"

colab_logica.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,3 +551,11 @@ def PostgresJumpStart():
551551
print('Installation succeeded. Connecting...')
552552
# Connect to the database.
553553
ConnectToLocalPostgres()
554+
555+
556+
def UseCppParser():
557+
os.environ['LOGICA_PARSER'] = 'CPP'
558+
from .parser_cpp import logica_parse_cpp # type: ignore
559+
so_path = logica_parse_cpp.EnsureCppParserSharedObject()
560+
logica_parse_cpp.LoadCppParserLib()
561+
return so_path

0 commit comments

Comments
 (0)