package jortsc with setup.py

add lark parser as dep
This commit is contained in:
Luna 2019-03-09 16:52:34 -03:00
parent a11d21873a
commit 9e8a5abdaa
4 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,3 @@
from .main import main
__all__ = ['main']

View file

@ -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
View 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
View 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
'''
)