.after(ElixirTypes.FN).spaces(1) .aroundInside( ElixirTypes.DUAL_OPERATOR, ADDITION_OPERATION_TOKEN_SET ).spaceIf(elixirCommonSettings.SPACE_AROUND_ADDITIVE_OPERATORS) .aroundInside( .aroundInside(ElixirTypes.DIVISION_OPERATOR, CAPTURE_NON_NUMERIC_OPERATION_TOKEN_SET).none() .around( MULTIPLICATIVE_OPERATOR_TOKEN_SET
.around(ASSIGN).spaces(1) .around(VAR_ASSIGN).spaces(1) .aroundInside(MUL, POINTER_TYPE).none() .before(ARGUMENT_LIST).none() .before(BUILTIN_ARGUMENT_LIST).none() .after(SWITCH).spaces(1) .afterInside(SEND_CHANNEL, UNARY_EXPR).none() .aroundInside(SEND_CHANNEL, SEND_STATEMENT).spaces(1) .afterInside(CHAN, CHANNEL_TYPE).spaces(1) .afterInside(MAP, MAP_TYPE).none() .aroundInside(LBRACK, MAP_TYPE).none() .aroundInside(RBRACK, MAP_TYPE).none() .beforeInside(LITERAL_VALUE, COMPOSITE_LIT).none() .afterInside(LBRACE, LITERAL_VALUE).none() .betweenInside(LBRACK, RBRACK, ARRAY_OR_SLICE_TYPE).none() .around(ASSIGN_OP).spaces(1) .aroundInside(OPERATORS, TokenSet.create(MUL_EXPR, ADD_EXPR, OR_EXPR, CONDITIONAL_EXPR)).spaces(1)
.aroundInside(QUESTION_MARK, TERNARY_EXPRESSION).spaceIf(true) .aroundInside(COLON, TERNARY_EXPRESSION).spaceIf(true) .aroundInside(DIV, IMPORT_DECLARATION).spaceIf(false) .aroundInside(DOT, COMPLETE_PACKAGE_NAME).spaceIf(false) .aroundInside(COLON, PACKAGE_REFERENCE).spaceIf(false) .afterInside(IDENTIFIER, CALLABLE_UNIT_SIGNATURE).spaceIf(false) .aroundInside(DOT, FUNCTION_DEFINITION).spaceIf(false) .around(CALLABLE_UNIT_SIGNATURE).spaceIf(true) .after(PACKAGE_REFERENCE).spaceIf(false) .aroundInside(NAME_REFERENCE, FUNCTION_INVOCATION).spaceIf(false) .around(INVOCATION_ARG_LIST).spaceIf(false) .before(CALLABLE_UNIT_BODY).spaceIf(true) .between(SIMPLE_VARIABLE_REFERENCE, WINDOW_CLAUSE).spaceIf(true) .after(SIMPLE_VARIABLE_REFERENCE).spaceIf(false) .aroundInside(DOT, INVOCATION).spaceIf(false) .between(INVOCATION_ARG, COMMA).spaceIf(false) .between(ANY_IDENTIFIER_NAME, LEFT_PARENTHESIS).spaceIf(false) .around(EXPRESSION_LIST).spaceIf(false) .between(ARRAY_TYPE_NAME, IDENTIFIER).spaceIf(true) .aroundInside(GT, TYPE_CONVERSION_EXPRESSION).spaceIf(false) .after(LEFT_PARENTHESIS).spaceIf(false) .before(RIGHT_PARENTHESIS).spaceIf(false) .aroundInside(RARROW, ACTION_INVOCATION).spaceIf(false) .between(IDENTIFIER, WORKER_BODY).spaceIf(true) .between(EXPRESSION_LIST, RARROW).spaceIf(true)
static SpacingBuilder getSpacingBuilder(CommonCodeStyleSettings settings, MathematicaCodeStyleSettings mathematicaSettings) { return new SpacingBuilder(settings.getRootSettings(), MathematicaLanguage.INSTANCE) .around(ourAssignments).spaceIf(mathematicaSettings.SPACE_AROUND_ASSIGNMENT_OPERATIONS) .around(ourArithmeticOperations).spaceIf(mathematicaSettings.SPACE_AROUND_ARITHMETIC_OPERATIONS) .aroundInside(MINUS, MINUS_EXPRESSION).spaceIf(mathematicaSettings.SPACE_AROUND_ARITHMETIC_OPERATIONS) .around(ourRelationalOperations).spaceIf(mathematicaSettings.SPACE_AROUND_RELATION_OPERATIONS) .around(ourRuleOperations).spaceIf(mathematicaSettings.SPACE_AROUND_RULE_OPERATIONS) .around(ourFunctionalOperations).spaceIf(mathematicaSettings.SPACE_AROUND_FUNCTIONAL_OPERATIONS) .around(ourOtherOperations).spaceIf(mathematicaSettings.SPACE_AROUND_OTHER_OPERATIONS) .after(COMMA).spaceIf(settings.SPACE_AFTER_COMMA) .before(LEFT_BRACKET).none() .after(RIGHT_BRACKET).none() ; } }
.between(FILTER_EXPRESSION, OP_PIPE).spaces(1) .aroundInside(PATTERN_ELEMENT, PATTERN_PART).none() .aroundInside(DASH, RELATIONSHIP_PATTERN).none() .aroundInside(LEFT_ARROW_HEAD, RELATIONSHIP_PATTERN).none() .aroundInside(RIGHT_ARROW_HEAD, RELATIONSHIP_PATTERN).none()
.around(OPERATORS_SHIFT).spaceIf(settings.SPACE_AROUND_SHIFT_OPERATORS) .around(OPERATORS_UNARY).spaceIf(settings.SPACE_AROUND_UNARY_OPERATOR) .aroundInside(OPERATORS_RANGE, FLIPFLOP_EXPR).spaceIf(perlSettings.SPACE_AROUND_RANGE_OPERATORS) .aroundInside(OPERATOR_CONCAT, ADD_EXPR).spaceIf(perlSettings.SPACE_AROUND_CONCAT_OPERATOR)