View | Details | Raw Unified | Return to bug 126625
Collapse All | Expand All

(-)formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java (+24 lines)
Lines 708-713 Link Here
708
	public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = JavaCore.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer";	//$NON-NLS-1$
708
	public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = JavaCore.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer";	//$NON-NLS-1$
709
	/**
709
	/**
710
	 * <pre>
710
	 * <pre>
711
	 * FORMATTER / Option to indent body declarations compare to its enclosing annotation declaration header
712
	 *     - option id:         "org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
713
	 *     - possible values:   { TRUE, FALSE }
714
	 *     - default:           TRUE
715
	 * </pre>
716
	 * @see #TRUE
717
	 * @see #FALSE
718
	 * @since 3.2
719
	 */
720
	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER = JavaCore.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_annotation_declaration_header";	//$NON-NLS-1$
721
	/**
722
	 * <pre>
711
	 * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
723
	 * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
712
	 *     - option id:         "org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
724
	 *     - option id:         "org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
713
	 *     - possible values:   { TRUE, FALSE }
725
	 *     - possible values:   { TRUE, FALSE }
Lines 953-958 Link Here
953
	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block";	//$NON-NLS-1$
965
	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block";	//$NON-NLS-1$
954
	/**
966
	/**
955
	 * <pre>
967
	 * <pre>
968
	 * FORMATTER / Option to insert a new line in an empty annotation declaration
969
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
970
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
971
	 *     - default:           INSERT
972
	 * </pre>
973
	 * @see JavaCore#INSERT
974
	 * @see JavaCore#DO_NOT_INSERT
975
	 * @since 3.1
976
	 */
977
	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_in_empty_annotation_declaration";	//$NON-NLS-1$
978
	/**
979
	 * <pre>
956
	 * FORMATTER / Option to insert a new line in an empty enum constant
980
	 * FORMATTER / Option to insert a new line in an empty enum constant
957
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
981
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
958
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
982
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (-4 / +2 lines)
Lines 1034-1041 Link Here
1034
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_enum_declaration_header;
1034
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_enum_declaration_header;
1035
				break;
1035
				break;
1036
			case TypeDeclaration.ANNOTATION_TYPE_DECL :
1036
			case TypeDeclaration.ANNOTATION_TYPE_DECL :
1037
				// TODO (olivier) might want to add an option for annotation type
1037
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_annotation_declaration_header;
1038
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_type_header;
1039
				break;
1038
				break;
1040
			default:
1039
			default:
1041
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_type_header;
1040
				indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_type_header;
Lines 1130-1137 Link Here
1130
				}
1129
				}
1131
				break;
1130
				break;
1132
			case TypeDeclaration.ANNOTATION_TYPE_DECL :
1131
			case TypeDeclaration.ANNOTATION_TYPE_DECL :
1133
				// TODO (olivier) might want an option for annotation type
1132
				if (this.preferences.insert_new_line_in_empty_annotation_declaration) {
1134
				if (this.preferences.insert_new_line_in_empty_type_declaration) {
1135
					this.scribe.printNewLine();
1133
					this.scribe.printNewLine();
1136
				}
1134
				}
1137
				break;
1135
				break;
(-)formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java (+16 lines)
Lines 108-113 Link Here
108
	
108
	
109
	public boolean indent_statements_compare_to_block;
109
	public boolean indent_statements_compare_to_block;
110
	public boolean indent_statements_compare_to_body;
110
	public boolean indent_statements_compare_to_body;
111
	public boolean indent_body_declarations_compare_to_annotation_declaration_header;
111
	public boolean indent_body_declarations_compare_to_enum_constant_header;
112
	public boolean indent_body_declarations_compare_to_enum_constant_header;
112
	public boolean indent_body_declarations_compare_to_enum_declaration_header;
113
	public boolean indent_body_declarations_compare_to_enum_declaration_header;
113
	public boolean indent_body_declarations_compare_to_type_header;
114
	public boolean indent_body_declarations_compare_to_type_header;
Lines 127-132 Link Here
127
	public boolean insert_new_line_before_while_in_do_statement;
128
	public boolean insert_new_line_before_while_in_do_statement;
128
	public boolean insert_new_line_in_empty_anonymous_type_declaration;
129
	public boolean insert_new_line_in_empty_anonymous_type_declaration;
129
	public boolean insert_new_line_in_empty_block;
130
	public boolean insert_new_line_in_empty_block;
131
	public boolean insert_new_line_in_empty_annotation_declaration;	
130
	public boolean insert_new_line_in_empty_enum_constant;
132
	public boolean insert_new_line_in_empty_enum_constant;
131
	public boolean insert_new_line_in_empty_enum_declaration;
133
	public boolean insert_new_line_in_empty_enum_declaration;
132
	public boolean insert_new_line_in_empty_method_body;
134
	public boolean insert_new_line_in_empty_method_body;
Lines 374-379 Link Here
374
		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body));
376
		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body));
375
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, this.indent_statements_compare_to_block ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
377
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, this.indent_statements_compare_to_block ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
376
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, this.indent_statements_compare_to_body ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
378
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, this.indent_statements_compare_to_body ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
379
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER, this.indent_body_declarations_compare_to_annotation_declaration_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
377
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER, this.indent_body_declarations_compare_to_enum_constant_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
380
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER, this.indent_body_declarations_compare_to_enum_constant_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
378
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER, this.indent_body_declarations_compare_to_enum_declaration_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
381
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER, this.indent_body_declarations_compare_to_enum_declaration_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
379
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, this.indent_body_declarations_compare_to_type_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
382
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, this.indent_body_declarations_compare_to_type_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
Lines 392-397 Link Here
392
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
395
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
393
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION, this.insert_new_line_in_empty_anonymous_type_declaration? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
396
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION, this.insert_new_line_in_empty_anonymous_type_declaration? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
394
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
397
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
398
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION, this.insert_new_line_in_empty_annotation_declaration ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
395
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT, this.insert_new_line_in_empty_enum_constant? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
399
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT, this.insert_new_line_in_empty_enum_constant? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
396
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION, this.insert_new_line_in_empty_enum_declaration? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
400
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION, this.insert_new_line_in_empty_enum_declaration? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
397
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
401
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
Lines 1051-1056 Link Here
1051
		if (indentStatementsCompareToBodyOption != null) {
1055
		if (indentStatementsCompareToBodyOption != null) {
1052
			this.indent_statements_compare_to_body = DefaultCodeFormatterConstants.TRUE.equals(indentStatementsCompareToBodyOption);
1056
			this.indent_statements_compare_to_body = DefaultCodeFormatterConstants.TRUE.equals(indentStatementsCompareToBodyOption);
1053
		}
1057
		}
1058
		final Object indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER);
1059
		if (indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption != null) {
1060
			this.indent_body_declarations_compare_to_annotation_declaration_header = DefaultCodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption);
1061
		}
1054
		final Object indentBodyDeclarationsCompareToEnumConstantHeaderOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER);
1062
		final Object indentBodyDeclarationsCompareToEnumConstantHeaderOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER);
1055
		if (indentBodyDeclarationsCompareToEnumConstantHeaderOption != null) {
1063
		if (indentBodyDeclarationsCompareToEnumConstantHeaderOption != null) {
1056
			this.indent_body_declarations_compare_to_enum_constant_header = DefaultCodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumConstantHeaderOption);
1064
			this.indent_body_declarations_compare_to_enum_constant_header = DefaultCodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumConstantHeaderOption);
Lines 1129-1134 Link Here
1129
		if (insertNewLineInEmptyBlockOption != null) {
1137
		if (insertNewLineInEmptyBlockOption != null) {
1130
			this.insert_new_line_in_empty_block = JavaCore.INSERT.equals(insertNewLineInEmptyBlockOption);
1138
			this.insert_new_line_in_empty_block = JavaCore.INSERT.equals(insertNewLineInEmptyBlockOption);
1131
		}
1139
		}
1140
		final Object insertNewLineInEmptyAnnotationDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION);
1141
		if (insertNewLineInEmptyAnnotationDeclarationOption != null) {
1142
			this.insert_new_line_in_empty_annotation_declaration = JavaCore.INSERT.equals(insertNewLineInEmptyAnnotationDeclarationOption);
1143
		}
1132
		final Object insertNewLineInEmptyEnumConstantOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT);
1144
		final Object insertNewLineInEmptyEnumConstantOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT);
1133
		if (insertNewLineInEmptyEnumConstantOption != null) {
1145
		if (insertNewLineInEmptyEnumConstantOption != null) {
1134
			this.insert_new_line_in_empty_enum_constant = JavaCore.INSERT.equals(insertNewLineInEmptyEnumConstantOption);
1146
			this.insert_new_line_in_empty_enum_constant = JavaCore.INSERT.equals(insertNewLineInEmptyEnumConstantOption);
Lines 1889-1894 Link Here
1889
		this.blank_lines_at_beginning_of_method_body = 0;
1901
		this.blank_lines_at_beginning_of_method_body = 0;
1890
		this.indent_statements_compare_to_block = true;
1902
		this.indent_statements_compare_to_block = true;
1891
		this.indent_statements_compare_to_body = true;
1903
		this.indent_statements_compare_to_body = true;
1904
		this.indent_body_declarations_compare_to_annotation_declaration_header = true;
1892
		this.indent_body_declarations_compare_to_enum_constant_header = true;
1905
		this.indent_body_declarations_compare_to_enum_constant_header = true;
1893
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
1906
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
1894
		this.indent_body_declarations_compare_to_type_header = true;
1907
		this.indent_body_declarations_compare_to_type_header = true;
Lines 1907-1912 Link Here
1907
		this.insert_new_line_before_while_in_do_statement = false;
1920
		this.insert_new_line_before_while_in_do_statement = false;
1908
		this.insert_new_line_in_empty_anonymous_type_declaration = true;
1921
		this.insert_new_line_in_empty_anonymous_type_declaration = true;
1909
		this.insert_new_line_in_empty_block = true;
1922
		this.insert_new_line_in_empty_block = true;
1923
		this.insert_new_line_in_empty_annotation_declaration = true;
1910
		this.insert_new_line_in_empty_enum_constant = true;
1924
		this.insert_new_line_in_empty_enum_constant = true;
1911
		this.insert_new_line_in_empty_enum_declaration = true;
1925
		this.insert_new_line_in_empty_enum_declaration = true;
1912
		this.insert_new_line_in_empty_method_body = true;
1926
		this.insert_new_line_in_empty_method_body = true;
Lines 2141-2146 Link Here
2141
		this.blank_lines_at_beginning_of_method_body = 0;
2155
		this.blank_lines_at_beginning_of_method_body = 0;
2142
		this.indent_statements_compare_to_block = true;
2156
		this.indent_statements_compare_to_block = true;
2143
		this.indent_statements_compare_to_body = true;
2157
		this.indent_statements_compare_to_body = true;
2158
		this.indent_body_declarations_compare_to_annotation_declaration_header = true;
2144
		this.indent_body_declarations_compare_to_enum_constant_header = true;
2159
		this.indent_body_declarations_compare_to_enum_constant_header = true;
2145
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
2160
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
2146
		this.indent_body_declarations_compare_to_type_header = true;
2161
		this.indent_body_declarations_compare_to_type_header = true;
Lines 2159-2164 Link Here
2159
		this.insert_new_line_before_while_in_do_statement = false;
2174
		this.insert_new_line_before_while_in_do_statement = false;
2160
		this.insert_new_line_in_empty_anonymous_type_declaration = true;
2175
		this.insert_new_line_in_empty_anonymous_type_declaration = true;
2161
		this.insert_new_line_in_empty_block = true;
2176
		this.insert_new_line_in_empty_block = true;
2177
		this.insert_new_line_in_empty_annotation_declaration = true;
2162
		this.insert_new_line_in_empty_enum_constant = true;
2178
		this.insert_new_line_in_empty_enum_constant = true;
2163
		this.insert_new_line_in_empty_enum_declaration = true;
2179
		this.insert_new_line_in_empty_enum_declaration = true;
2164
		this.insert_new_line_in_empty_method_body = true;
2180
		this.insert_new_line_in_empty_method_body = true;
(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor2.java (-8 / +6 lines)
Lines 916-923 Link Here
916
		final List bodyDeclarations = node.bodyDeclarations();
916
		final List bodyDeclarations = node.bodyDeclarations();
917
		formatTypeOpeningBrace(class_declaration_brace, space_before_opening_brace, bodyDeclarations.size() != 0, node);
917
		formatTypeOpeningBrace(class_declaration_brace, space_before_opening_brace, bodyDeclarations.size() != 0, node);
918
		
918
		
919
		// TODO (olivier) might want to add an option for annotation type
919
		boolean indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_annotation_declaration_header;
920
		boolean indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_type_header;
921
		if (indent_body_declarations_compare_to_header) {
920
		if (indent_body_declarations_compare_to_header) {
922
			this.scribe.indent();
921
			this.scribe.indent();
923
		}
922
		}
Lines 928-935 Link Here
928
			this.scribe.unIndent();
927
			this.scribe.unIndent();
929
		}
928
		}
930
		
929
		
931
		// TODO (olivier) might want an option for annotation type
930
		if (this.preferences.insert_new_line_in_empty_annotation_declaration) {
932
		if (this.preferences.insert_new_line_in_empty_type_declaration) {
933
			this.scribe.printNewLine();
931
			this.scribe.printNewLine();
934
		}
932
		}
935
		this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
933
		this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
Lines 1899-1905 Link Here
1899
							if (this.preferences.insert_space_after_comma_in_for_inits) {
1897
							if (this.preferences.insert_space_after_comma_in_for_inits) {
1900
								this.scribe.space();
1898
								this.scribe.space();
1901
							}
1899
							}
1902
							// TODO (olivier) need to check why we need this here
1903
							this.scribe.printTrailingComment();
1900
							this.scribe.printTrailingComment();
1904
						}
1901
						}
1905
				}
1902
				}
Lines 1963-1969 Link Here
1963
					 * statement
1960
					 * statement
1964
					 */
1961
					 */
1965
					this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block);
1962
					this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block);
1966
					// TODO (olivier) might need an option for this
1967
					this.scribe.space();
1963
					this.scribe.space();
1968
					((Statement) statements.get(0)).accept(this);
1964
					((Statement) statements.get(0)).accept(this);
1969
					this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true);
1965
					this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true);
Lines 2601-2609 Link Here
2601
	}
2597
	}
2602
2598
2603
	public boolean visit(NumberLiteral node) {
2599
	public boolean visit(NumberLiteral node) {
2604
		// TODO (olivier) possible option for space
2605
		if (isNextToken(TerminalTokens.TokenNameMINUS)) {
2600
		if (isNextToken(TerminalTokens.TokenNameMINUS)) {
2606
			this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);			
2601
			this.scribe.printNextToken(TerminalTokens.TokenNameMINUS, this.preferences.insert_space_before_unary_operator);
2602
			if (this.preferences.insert_space_after_unary_operator) {
2603
				this.scribe.space();
2604
			}
2607
		}
2605
		}
2608
		this.scribe.printNextToken(NUMBER_LITERALS_EXPECTEDTOKENS); 
2606
		this.scribe.printNextToken(NUMBER_LITERALS_EXPECTEDTOKENS); 
2609
		return false;
2607
		return false;

Return to bug 126625