comparison Resources/CodeGeneration/stonegentool.py @ 674:163ac23b8bff am-dev

cleanup + fix warning in codegen
author Alain Mazy <alain@mazy.be>
date Thu, 16 May 2019 09:25:42 +0200
parents 5dd496343fad
children 1b47f17863ba
comparison
equal deleted inserted replaced
673:3f13f7f1b55d 674:163ac23b8bff
531 nextCh = schemaText[i+1] 531 nextCh = schemaText[i+1]
532 if ch == ':': 532 if ch == ':':
533 if not (nextCh == ' ' or nextCh == '\n'): 533 if not (nextCh == ' ' or nextCh == '\n'):
534 lineNumber = schemaText.count("\n",0,i) + 1 534 lineNumber = schemaText.count("\n",0,i) + 1
535 raise RuntimeError("Error at line " + str(lineNumber) + " in the schema: colons must be followed by a space or a newline!") 535 raise RuntimeError("Error at line " + str(lineNumber) + " in the schema: colons must be followed by a space or a newline!")
536 schema = yaml.load(schemaText) 536 schema = yaml.load(schemaText, Loader = yaml.SafeLoader)
537 print("*******************************************")
538 print("*******************************************")
539 print(schema["struct EventBase"])
540 print("*******************************************")
541 print("*******************************************")
542 return schema 537 return schema
543 538
544 def GetTemplatingDictFromSchemaFilename(fn): 539 def GetTemplatingDictFromSchemaFilename(fn):
545 return GetTemplatingDictFromSchema(LoadSchema(fn)) 540 return GetTemplatingDictFromSchema(LoadSchema(fn))
546 541