Skip to content

Commit

Permalink
Move tidal.boot to boot/tidal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Qirky committed Jan 24, 2019
1 parent 20c0887 commit 862e753
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Empty file added src/boot/__init__.py
Empty file.
5 changes: 3 additions & 2 deletions src/boot/tidal.boot → src/boot/tidal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:set -XOverloadedStrings
bootstrap = """:set -XOverloadedStrings
:set prompt ""
:set prompt-cont ""
Expand Down Expand Up @@ -53,4 +53,5 @@
let d15 = p 15
let d16 = p 16
:set prompt "tidal> "
:set prompt "tidal> "
"""
11 changes: 6 additions & 5 deletions src/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,13 @@ def __init__(self, *args, **kwargs):

def execute_setup_code(self):
# Import and setup tidal
with open(TIDAL_BOOT_FILE) as f:

for line in f.readlines():
from .boot.tidal import bootstrap

self.process.stdin.write(line.rstrip() + "\n")
self.process.stdin.flush()
for line in bootstrap.split("\n"):

self.process.stdin.write(line.rstrip() + "\n")
self.process.stdin.flush()

return

Expand Down Expand Up @@ -376,7 +377,7 @@ def get_reset_code(self, local_code, codelet_code):

reset_code.append(codelet_code)

return "do {\n" + ";\n".join(reset_code) + "}\n"
return "do {\n" + ";\n".join(reset_code) + "\n}\n"

def format_code(self, string):
""" Used to formant multiple lines in haskell """
Expand Down

0 comments on commit 862e753

Please sign in to comment.