INNER CODE UNIT · Python

parse

OverShifted/OverEngine · utils/wren_doc_gen.py:113

	def parse(self, source: str):
		for line in source.splitlines():
			line = line.replace('\t', ' ' * 4)
			stripped_line = line.strip()
			indent = WrenParser.indent_level(line)

			# classes
			if indent == 0:
				if stripped_line.startswith("foreign class"):
					self.klass(Class(stripped_line[len("foreign class"):].replace('{', '').strip(), True))
				elif stripped_line.startswith("class"):
					self.klass(Class(stripped_line[len("class"):].replace('{', '').strip(), False))
				elif stripped_line.startswith("///"):
					self.doc(stripped_line)
				# elif stripped_line.startswith("#"):
				# 	self.klass_attribute(stripped_line[1:])

			# methods

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…