Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
@follow up
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Sep 18, 2015
1 parent ee685a0 commit 08a7e95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2014, 2015 Bruno Medeiros and other Contributors. * Copyright (c) 2014 Bruno Medeiros and other Contributors.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
Expand All @@ -10,22 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package LANG_PROJECT_ID.ide.core.text; package LANG_PROJECT_ID.ide.core.text;


import org.eclipse.jface.text.rules.IPredicateRule;

import melnorme.lang.ide.core.TextSettings_Actual.LangPartitionTypes; import melnorme.lang.ide.core.TextSettings_Actual.LangPartitionTypes;
import melnorme.lang.ide.core.text.LexingRulePredicateRule; import melnorme.lang.ide.core.text.LangPartitionScanner;
import melnorme.lang.ide.core.text.RuleBasedPartitionScannerExt;
import melnorme.lang.tooling.parser.lexer.CharacterLexingRule; import melnorme.lang.tooling.parser.lexer.CharacterLexingRule;
import melnorme.utilbox.collections.ArrayList2; import melnorme.utilbox.collections.ArrayList2;


import org.eclipse.jface.text.rules.IPredicateRule; public class LANGUAGE_PartitionScanner extends LangPartitionScanner {

public class LANGUAGE_PartitionScanner extends RuleBasedPartitionScannerExt {


public LANGUAGE_PartitionScanner() { public LANGUAGE_PartitionScanner() {
super(); super();
} }


@Override @Override
protected void addRules(ArrayList2<IPredicateRule> rules) { protected void initPredicateRules(ArrayList2<IPredicateRule> rules) {
addStandardRules(rules, addStandardRules(rules,
LangPartitionTypes.LINE_COMMENT.getId(), LangPartitionTypes.LINE_COMMENT.getId(),
LangPartitionTypes.BLOCK_COMMENT.getId(), LangPartitionTypes.BLOCK_COMMENT.getId(),
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
*******************************************************************************/ *******************************************************************************/
package LANG_PROJECT_ID.ide.ui.text; package LANG_PROJECT_ID.ide.ui.text;


import java.util.ArrayList;
import java.util.List;

import melnorme.lang.ide.ui.text.coloring.AbstractLangScanner;

import org.eclipse.jface.text.rules.IRule; import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken; import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.WhitespaceRule; import org.eclipse.jface.text.rules.WhitespaceRule;
import org.eclipse.jface.text.rules.WordRule; import org.eclipse.jface.text.rules.WordRule;


import _org.eclipse.cdt.ui.text.ITokenStoreFactory; import _org.eclipse.cdt.ui.text.ITokenStoreFactory;
import melnorme.lang.ide.ui.text.AbstractLangScanner;
import melnorme.utilbox.collections.ArrayList2;


/** /**
* Sample LANGUAGE code scanner * Sample LANGUAGE code scanner
Expand All @@ -35,11 +32,10 @@ public class LANGUAGE_CodeScanner extends AbstractLangScanner {


public LANGUAGE_CodeScanner(ITokenStoreFactory factory) { public LANGUAGE_CodeScanner(ITokenStoreFactory factory) {
super(factory.createTokenStore(tokenPrefProperties)); super(factory.createTokenStore(tokenPrefProperties));
setRules(createRules());
} }


protected List<IRule> createRules() { @Override
List<IRule> rules = new ArrayList<IRule>(); protected void initRules(ArrayList2<IRule> rules) {


IToken tkOther = getToken(LANGUAGE_ColorPreferences.DEFAULT.key); IToken tkOther = getToken(LANGUAGE_ColorPreferences.DEFAULT.key);
IToken tkKeywords = getToken(LANGUAGE_ColorPreferences.KEYWORDS.key); IToken tkKeywords = getToken(LANGUAGE_ColorPreferences.KEYWORDS.key);
Expand All @@ -60,7 +56,6 @@ protected List<IRule> createRules() {
rules.add(wordRule); rules.add(wordRule);


setDefaultReturnToken(tkOther); setDefaultReturnToken(tkOther);
return rules;
} }


} }

0 comments on commit 08a7e95

Please sign in to comment.