Ignore:
Timestamp:
10/21/15 02:55:11 (9 years ago)
Author:
Mateusz Poszwa
Message:
  • Updated Xtext-based Framclipse
  • Deleted previous version of Framclipse
File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java

    r437 r440  
    1717
    1818/**
    19  * This class contains custom formatting description.
     19 * This class contains custom formatting declarations.
    2020 *
    21  * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#formatting
    22  * on how and when to use it
     21 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#formatting
     22 * on how and when to use it.
    2323 *
    24  * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an
    25  * example
     24 * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
    2625 */
    2726public class FramScriptFormatter extends AbstractDeclarativeFormatter {
    28        
    29         @Override
    30         protected FramScriptGrammarAccess getGrammarAccess() {
    31                 return (FramScriptGrammarAccess) super.getGrammarAccess();
    32         }
    33 
    3427        @Override
    3528        protected void configureFormatting(FormattingConfig c) {
    36                 FramScriptGrammarAccess f = getGrammarAccess();
     29                FramScriptGrammarAccess f = (FramScriptGrammarAccess) getGrammarAccess();
    3730               
    3831                //Headers
     
    6861                c.setNoSpace().before(f.getFlagsHeaderAccess().getIntValueAssignment_2());
    6962               
    70                 c.setNoSpace().after(f.getTypeHeaderAccess().getNameTypeKeyword_0_0());
     63                c.setNoSpace().after(f.getTypeHeaderAccess().getNameTYPE_HEADERTerminalRuleCall_0_0());
    7164                c.setLinewrap().after(f.getTypeHeaderAccess().getTypeAssignment_1());
    7265               
     
    9487                // BlockIndentation
    9588                BlockElements block = f.getBlockAccess();
    96                 c.setIndentation(block.getLeftCurlyBracketKeyword_1(),
    97                                 block.getRightCurlyBracketKeyword_3());
    98                 c.setLinewrap().before(block.getLeftCurlyBracketKeyword_1());
    99                 c.setLinewrap().after(block.getLeftCurlyBracketKeyword_1());
    100                 c.setLinewrap().after(block.getRightCurlyBracketKeyword_3());
     89                c.setIndentation(block.getLeftCurlyBracketKeyword_0(),
     90                                block.getRightCurlyBracketKeyword_2());
     91                c.setLinewrap().before(block.getLeftCurlyBracketKeyword_0());
     92                c.setLinewrap().after(block.getLeftCurlyBracketKeyword_0());
     93                c.setLinewrap().after(block.getRightCurlyBracketKeyword_2());
    10194
    10295                // Param
     
    10497                c.setNoLinewrap().around(fullStop);
    10598                c.setNoSpace().around(fullStop);
    106                 c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_0());
     99                c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_1());
     100                c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_2());
    107101               
    108102                // Invocation
     
    117111               
    118112                //Arrays
    119                 c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_0());
     113                c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_1());
    120114                c.setNoSpace().before(f.getArrayAccess().getRightSquareBracketKeyword_3());
    121                 c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_0());
     115                c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_1_0());
    122116               
    123117                // Unary expression
Note: See TracChangeset for help on using the changeset viewer.