File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ impl<'a> Codegen<'a> {
197197 pub fn build ( mut self , program : & Program < ' a > ) -> CodegenReturn {
198198 self . quote = if self . options . single_quote { Quote :: Single } else { Quote :: Double } ;
199199 self . source_text = Some ( program. source_text ) ;
200+ self . indent = self . options . initial_indent ;
200201 self . code . reserve ( program. source_text . len ( ) ) ;
201202 self . build_comments ( & program. comments ) ;
202203 if let Some ( path) = & self . options . source_map_path {
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ pub struct CodegenOptions {
3838 ///
3939 /// Default is `1`.
4040 pub indent_width : usize ,
41+
42+ /// Initial indentation level.
43+ pub initial_indent : u32 ,
4144}
4245
4346impl Default for CodegenOptions {
@@ -49,6 +52,7 @@ impl Default for CodegenOptions {
4952 source_map_path : None ,
5053 indent_char : IndentChar :: default ( ) ,
5154 indent_width : DEFAULT_INDENT_WIDTH ,
55+ initial_indent : 0 ,
5256 }
5357 }
5458}
@@ -63,6 +67,7 @@ impl CodegenOptions {
6367 source_map_path : None ,
6468 indent_char : IndentChar :: default ( ) ,
6569 indent_width : DEFAULT_INDENT_WIDTH ,
70+ initial_indent : 0 ,
6671 }
6772 }
6873
You can’t perform that action at this time.
0 commit comments