MCPcopy Index your code
hub / github.com/InkboxSoftware/excelCPU / parseLine

Function parseLine

compileExcelASM16.py:403–429  ·  view source on GitHub ↗
(line, lineNumber)

Source from the content-addressed store, hash-verified

401 compileResults()
402
403def parseLine(line, lineNumber):
404 global labelOpen
405 global labelToUse
406 labelLine = line.split(":");
407 label = labelLine[0]
408 if (":" in line and len(labelLine[1]) <= 1):
409 if (labelOpen):
410 labelError(lineNumber)
411 labelToUse = label #add a label with no operations to program
412 labelOpen = True
413 return
414 elif (":" not in line):
415 if (labelOpen):
416 label = labelToUse
417 labelOpen = False
418 else:
419 label = ""
420 else:
421 if (labelOpen):
422 labelError(lineNumber)
423 line = labelLine[1].strip()
424 line = line.split(" ")
425 #print(str(lineNumber) + "\t" + str(label) + "\t" + str(line))
426 operations = encode(line, lineNumber)
427 if (not(operations == None)):
428 program.append(createLine(label, operations))
429 return
430
431def sendToSpreadsheet():
432 #load excel file

Callers 1

compileASMFunction · 0.85

Calls 3

labelErrorFunction · 0.85
encodeFunction · 0.85
createLineFunction · 0.85

Tested by

no test coverage detected