File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44//! Note that all functions here intended to be stupid constructors, which just
55//! assemble a finish node from immediate children. If you want to do something
66//! smarter than that, it probably doesn't belong in this module.
7+ //!
8+ //! Keep in mind that `from_text` functions should be kept private. The public
9+ //! API should require to assemble every node piecewise. The trick of
10+ //! `parse(format!())` we use internally is an implementation detail -- long
11+ //! term, it will be replaced with direct tree manipulation.
712use itertools:: Itertools ;
813use stdx:: format_to;
914
@@ -16,7 +21,8 @@ pub fn name(text: &str) -> ast::Name {
1621pub fn name_ref ( text : & str ) -> ast:: NameRef {
1722 ast_from_text ( & format ! ( "fn f() {{ {}; }}" , text) )
1823}
19-
24+ // FIXME: replace stringly-typed constructor with a family of typed ctors, a-la
25+ // `expr_xxx`.
2026pub fn ty ( text : & str ) -> ast:: Type {
2127 ast_from_text ( & format ! ( "impl {} for D {{}};" , text) )
2228}
You can’t perform that action at this time.
0 commit comments