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
3d55f49e
Commit
3d55f49e
authored
Mar 06, 2019
by
eckhart
Browse files
- stub for a compilation-server-module extended
parent
e7bf6e42
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/dsl.py
View file @
3d55f49e
...
...
@@ -103,7 +103,7 @@ if __name__ == "__main__":
file_name, log_dir = sys.argv[1], ''
if file_name in ['-d', '--debug'] and len(sys.argv) > 2:
file_name, log_dir = sys.argv[2], 'LOGS'
result, errors,
ast
= compile_src(file_name, log_dir)
result, errors,
_
= compile_src(file_name, log_dir)
if errors:
cwd = os.getcwd()
rel_path = file_name[len(cwd):] if file_name.startswith(cwd) else file_name
...
...
@@ -115,6 +115,7 @@ if __name__ == "__main__":
else:
print("Usage: {NAME}Compiler.py [FILENAME]")
'''
# TODO: Add support for spawning a compilation server via supprocess.Popen() to DHParser main
class
DSLException
(
Exception
):
...
...
test/test_server.py
View file @
3d55f49e
...
...
@@ -42,8 +42,7 @@ class TestServer:
p
=
Process
(
target
=
cs
.
run_server
)
p
.
start
()
async
def
compile
(
src
,
log_dir
):
reader
,
writer
=
await
asyncio
.
open_connection
(
'127.0.0.1'
,
8888
)
reader
,
writer
=
await
asyncio
.
open_connection
(
'127.0.0.1'
,
8888
)
writer
.
write
(
src
.
encode
())
data
=
await
reader
.
read
(
100
)
print
(
f
'Received:
{
data
.
decode
()
!r}
'
)
...
...
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