forked from luna/jorts
package jortsc with setup.py
add lark parser as dep
This commit is contained in:
parent
a11d21873a
commit
9e8a5abdaa
4 changed files with 30 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
from .main import main
|
||||
|
||||
__all__ = ['main']
|
|
@ -3,7 +3,7 @@
|
|||
import sys
|
||||
import pprint
|
||||
|
||||
from parser.lexer import lex_jorts
|
||||
from jortsc.parser.lexer import lex_jorts
|
||||
|
||||
def main():
|
||||
"""main entry point"""
|
||||
|
|
12
jortsc/parser/parser.py
Normal file
12
jortsc/parser/parser.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
from lark import Lark
|
||||
|
||||
# TODO: write a grammar
|
||||
GRAMMAR = """
|
||||
yeet
|
||||
"""
|
||||
|
||||
def parse(string: str):
|
||||
"""Parse"""
|
||||
parser = Lark(GRAMMAR, parser='lalr', debug=True)
|
||||
return parser.parse(string)
|
14
setup.py
Normal file
14
setup.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='jortsc',
|
||||
version='0.1',
|
||||
py_modules=['jortsc'],
|
||||
install_requires=[
|
||||
'lark-parser==0.6.7'
|
||||
],
|
||||
entry_points='''
|
||||
[console_scripts]
|
||||
jortsc=jortsc:main
|
||||
'''
|
||||
)
|
Loading…
Reference in a new issue