OILS / tools / fmt.py View on Github | oilshell.org

25 lines, 10 significant
1from __future__ import print_function
2"""
3fmt.py: Stub for code formatter.
4
5See doc/pretty-printing.md.
6"""
7
8from mycpp import mylib
9from tools import ysh_ify
10
11from typing import TYPE_CHECKING
12if TYPE_CHECKING:
13 from _devbuild.gen.syntax_asdl import command_t
14 from core import alloc
15
16
17def Format(arena, node):
18 # type: (alloc.Arena, command_t) -> None
19 """
20 Stub that prints, copied from ysh_ify.LosslessCat
21
22 TODO: implement formatter (on a coarse tree)
23 """
24 cursor = ysh_ify.Cursor(arena, mylib.Stdout())
25 cursor.PrintUntilEnd()