def __init__(s): super(Editor, s).__init__() s.root = nodes.make_root() s.root.fix_parents() s.atts = Atts(dict(left={},right={},middle={})) s.on_serverside_change = Signal(1) s.on_atts_change = Signal(0)
def __init__(self): super(Root, self).__init__() self.cursor_c = self.cursor_r = 0 self.root = nodes.make_root() self.root.fix_parents() self.arrows_visible = True self.cursor_blink_phase = True self.menu_dirty = True if args.noalpha: self.arrows_visible = False
def __init__(s): super(Editor, s).__init__() s.root = nodes.make_root() lc.build_in_lc1(s.root) lc.build_in_lc2(s.root) lc.build_in_cube(s.root) mltt.build_in_MLTT(s.root) s.root.fix_parents() s.atts = Atts(dict(left={},right={},middle={})) s.on_serverside_change = Signal(1) s.on_atts_change = Signal(0)
ts = m.string2tokens(text) print ("tokens", ts) m.enqueue_parsing([ts, text]) #recurse to wait for 'parsed' return handle() elif msg.message == 'parsed': print (len(msg.results), "results") return msg.results def parse(text): for i,x in enumerate(text):#this just prints the characters you got from stdin print(i, x)#prefixed by their position in the string m.enqueue_precomputation(None) return handle(text) r = nodes.make_root() scope = r['repl'].scope() m.collect_grammar(scope,scope,nodes.B.statement) if __name__=='__main__': if len(sys.argv) == 3 and sys.argv[1] == '-c': text = sys.argv[2] elif len(sys.argv) == 2: text = open(sys.argv[1]).read() elif len(sys.argv) == 1: text = sys.stdin.read()[:-1] else: assert (false) print ("input:\n" + text) p=parse(text)[0] print (p.eval()) #reads stdin, cuts off last char