Skip to content

Commit a61df4c

Browse files
committed
250609.1
1 parent 83d467f commit a61df4c

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed
Binary file not shown.

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
from .ec_timestamp import *
1010
from .ec_value import *
1111

12-
__version__ = "250608.1"
12+
__version__ = "250609.1"

easycoder/ec_core.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def k_exit(self, command):
386386
return True
387387

388388
def r_exit(self, command):
389-
if self.program.graphics != None:
389+
if self.program.parent == None and self.program.graphics != None:
390390
self.program.graphics.force_exit(None)
391391
return -1
392392

@@ -601,6 +601,7 @@ def k_import(self, command):
601601
variable['name'] = name
602602
variable['keyword'] = keyword
603603
variable['import'] = None
604+
variable['used'] = False
604605
self.addCommand(variable)
605606
if self.peek() != 'and':
606607
break
@@ -1203,9 +1204,9 @@ def k_run(self, command):
12031204
if record['keyword'] == 'module':
12041205
name = record['name']
12051206
command['module'] = name
1206-
else: RuntimeError(self.program, f'Symbol \'name\' is not a module')
1207-
else: RuntimeError(self.program, 'Module name expected after \'as\'')
1208-
else: RuntimeError(self.program, '\'as {module name}\' expected')
1207+
else: FatalError(self.compiler, f'Symbol \'name\' is not a module')
1208+
else: FatalError(self.compiler, 'Module name expected after \'as\'')
1209+
else: FatalError(self.compiler, '\'as {module name}\' expected')
12091210
exports = []
12101211
if self.peek() == 'with':
12111212
self.nextToken()
@@ -1333,6 +1334,12 @@ def k_set(self, command):
13331334
command['value'] = self.nextValue()
13341335
self.add(command)
13351336
return True
1337+
1338+
elif token == 'path':
1339+
command['path'] = self.nextValue()
1340+
self.add(command)
1341+
return True
1342+
13361343
return False
13371344

13381345
def r_set(self, command):
@@ -1384,6 +1391,11 @@ def r_set(self, command):
13841391
self.encoding = self.getRuntimeValue(command['encoding'])
13851392
return self.nextPC()
13861393

1394+
elif cmdType == 'path':
1395+
path = self.getRuntimeValue(command['path'])
1396+
os.chdir(path)
1397+
return self.nextPC()
1398+
13871399
elif cmdType == 'property':
13881400
value = self.getRuntimeValue(command['value'])
13891401
name = self.getRuntimeValue(command['name'])
@@ -1624,6 +1636,7 @@ def r_unlock(self, command):
16241636
target['locked'] = False
16251637
return self.nextPC()
16261638

1639+
# Use a plugin module
16271640
def k_use(self, command):
16281641
if self.nextIs('graphics'):
16291642
print('Loading graphics module')

easycoder/ec_program.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,8 @@ def flush(self, pc):
317317
queue = deque()
318318
if self.parent != None:
319319
self.releaseParent()
320-
else:
321-
self.running = False
322-
break
320+
self.running = False
321+
break
323322
elif self.pc == None or self.pc == 0 or self.pc >= len(self.code):
324323
break
325324

0 commit comments

Comments
 (0)