Skip to content

Commit

Permalink
All operators added
Browse files Browse the repository at this point in the history
  • Loading branch information
MortyHub committed Dec 24, 2021
1 parent 6e2b92d commit 992dba9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
Binary file modified DIVI/src/compiler/__pycache__/compile.cpython-38.pyc
Binary file not shown.
65 changes: 65 additions & 0 deletions DIVI/src/compiler/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,71 @@ def Mult(inc):
new = inc
Mult(new)
break

if '>' in cals[0]:
use = cals[0].split('>')
first = VARIABLE_VAL[VARIABLES.index(use[0])]
second = VARIABLE_VAL[VARIABLES.index(use[1])]
if first > second:
needed = inc[inc.index('if ' + str(smool[1])):inc.index(';')]
del needed[0]
Mult(needed)
inc[inc.index('if ' + str(smool[1])):inc.index(';')] = ['']
new = inc
Mult(new)
break

if '<' in cals[0]:
use = cals[0].split('<')
first = VARIABLE_VAL[VARIABLES.index(use[0])]
second = VARIABLE_VAL[VARIABLES.index(use[1])]
if first < second:
needed = inc[inc.index('if ' + str(smool[1])):inc.index(';')]
del needed[0]
Mult(needed)
inc[inc.index('if ' + str(smool[1])):inc.index(';')] = ['']
new = inc
Mult(new)
break

if '!=' in cals[0]:
use = cals[0].split('!=')
first = VARIABLE_VAL[VARIABLES.index(use[0])]
second = VARIABLE_VAL[VARIABLES.index(use[1])]
if first != second:
needed = inc[inc.index('if ' + str(smool[1])):inc.index(';')]
del needed[0]
Mult(needed)
inc[inc.index('if ' + str(smool[1])):inc.index(';')] = ['']
new = inc
Mult(new)
break

if '>=' in cals[0]:
use = cals[0].split('==')
first = VARIABLE_VAL[VARIABLES.index(use[0])]
second = VARIABLE_VAL[VARIABLES.index(use[1])]
if first >= second:
needed = inc[inc.index('if ' + str(smool[1])):inc.index(';')]
del needed[0]
Mult(needed)
inc[inc.index('if ' + str(smool[1])):inc.index(';')] = ['']
new = inc
Mult(new)
break

if '<=' in cals[0]:
use = cals[0].split('<=')
first = VARIABLE_VAL[VARIABLES.index(use[0])]
second = VARIABLE_VAL[VARIABLES.index(use[1])]
if first <= second:
needed = inc[inc.index('if ' + str(smool[1])):inc.index(';')]
del needed[0]
Mult(needed)
inc[inc.index('if ' + str(smool[1])):inc.index(';')] = ['']
new = inc
Mult(new)
break


else:
Expand Down

0 comments on commit 992dba9

Please sign in to comment.