Skip to content

Commit 20bad86

Browse files
committed
250404.1
1 parent 4c8e6f2 commit 20bad86

9 files changed

+14
-6
lines changed
-12.6 KB
Binary file not shown.

dist/easycoder-250403.1.tar.gz

-11.4 KB
Binary file not shown.
33.4 KB
Binary file not shown.

dist/easycoder-250403.2.tar.gz

3.1 MB
Binary file not shown.
33.4 KB
Binary file not shown.

dist/easycoder-250404.1.tar.gz

3.1 MB
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__ = "250403.1"
12+
__version__ = "250404.1"

easycoder/ec_core.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,11 +2420,16 @@ def compileCondition(self):
24202420

24212421
if self.getToken() == 'file':
24222422
path = self.nextValue()
2423-
if self.peek() == 'exists':
2424-
condition.type = 'exists'
2425-
condition.path = path
2426-
self.nextToken()
2423+
condition.path = path
2424+
condition.type = 'exists'
2425+
token = self.nextToken()
2426+
if token == 'exists':
24272427
return condition
2428+
elif token == 'does':
2429+
if self.nextIs('not'):
2430+
if self.nextIs('exist'):
2431+
condition.negate = not condition.negate
2432+
return condition
24282433
return None
24292434

24302435
value = self.getValue()
@@ -2534,7 +2539,8 @@ def c_even(self, condition):
25342539

25352540
def c_exists(self, condition):
25362541
path = self.getRuntimeValue(condition.path)
2537-
return os.path.exists(path)
2542+
comparison = os.path.exists(path)
2543+
return not comparison if condition.negate else comparison
25382544

25392545
def c_greater(self, condition):
25402546
comparison = self.program.compare(condition.value1, condition.value2)

test.ecs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
! split Text on ` `
1111
! index Text to 2
1212
print Text
13+
put `junk` into Text
14+
if file Text does not exist print `Yes`
1315
exit

0 commit comments

Comments
 (0)