Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
ee1d891c
Commit
ee1d891c
authored
Jan 22, 2019
by
di68kap
Browse files
- more preparation for cython usage
parent
b43f4d00
Changes
7
Hide whitespace changes
Inline
Side-by-side
DHParser/
error
.pxd
→
DHParser/
compile
.pxd
View file @
ee1d891c
...
...
@@ -4,11 +4,3 @@
#cython: c_string_encoding=utf-8
import
cython
cdef
class
Error
:
cdef
str
message
cdef
int
_pos
cdef
object
code
cdef
int
orig_pos
cdef
int
line
cdef
int
column
DHParser/compile.py
View file @
ee1d891c
...
...
@@ -35,7 +35,6 @@ compiler object.
"""
import
copy
import
os
import
re
from
DHParser.preprocess
import
strip_tokens
,
with_source_mapping
,
PreprocessorFunc
...
...
DHParser/ebnf.pxd
0 → 100644
View file @
ee1d891c
#cython: infer_types=True
#cython: language_level=3
#cython: c_string_type=unicode
#cython: c_string_encoding=utf-8
import
cython
DHParser/error.py
View file @
ee1d891c
...
...
@@ -94,12 +94,12 @@ class Error:
assert
not
isinstance
(
pos
,
ErrorCode
)
assert
pos
>=
0
assert
code
>=
0
self
.
message
=
message
self
.
_pos
=
pos
self
.
code
=
code
self
.
orig_pos
=
orig_pos
self
.
line
=
line
self
.
column
=
column
self
.
message
=
message
# type: str
self
.
_pos
=
pos
# type: int
self
.
code
=
code
# type: ErrorCode
self
.
orig_pos
=
orig_pos
# type: int
self
.
line
=
line
# type: int
self
.
column
=
column
# type: int
def
__str__
(
self
):
prefix
=
''
...
...
DHParser/syntaxtree.pxd
View file @
ee1d891c
...
...
@@ -17,8 +17,12 @@ import cython
# pass
# cdef class Node:
# cdef int _pos
# cdef int _len
# cdef object errors
# cdef int _pos
# cdef object _result
# cdef str _content
# cdef int _len
# cdef object parser
# cdef class RootNode(Node):
# pass
build_cython-modules.bat
View file @
ee1d891c
del
DHParser
\
*
.pyd
del
DHParser
\
*
.c
python
.exe
setup
.py
build_ext
--inplace
setup.py
View file @
ee1d891c
...
...
@@ -17,7 +17,8 @@ setup(
packages
=
[
'DHParser'
],
ext_modules
=
cythonize
([
'DHParser/stringview.py'
,
'DHParser/syntaxtree.py'
,
'DHParser/parse.py'
,
'DHParser/transform.py'
,
'DHParser/error.py'
]),
'DHParser/compile.py'
,
'DHParser/ebnf.py'
],
nthreads
=
0
,
annotate
=
False
),
url
=
'https://gitlab.lrz.de/badw-it/DHParser'
,
license
=
'[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0)'
,
author
=
'Eckhart Arnold'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment