2121
2222/**
2323 * JavaScript code scanner for source code highlighting.
24+ * @author Chromium Authors
25+ * @author Paul Verest
2426 */
2527public class JsCodeScanner extends BufferedRuleBasedScanner {
2628
2729 private Token commentToken ;
2830
2931 private final TextAttribute commentAttribute =
30- new TextAttribute (EditorColors .getColor (new RGB (63 , 127 , 95 )), null , SWT .NORMAL );
32+ new TextAttribute (EditorColors .getColor (new RGB (63 , 127 , 95 )), null , SWT .NORMAL ); //! hard-coded
3133
3234 private final TextAttribute jsDocAttribute =
33- new TextAttribute (EditorColors .getColor (new RGB (127 ,127 ,159 )), null , SWT .NORMAL );
35+ new TextAttribute (EditorColors .getColor (new RGB (127 ,127 ,159 )), null , SWT .NORMAL ); //! hard-coded
3436
3537 public JsCodeScanner () {
3638 createRules ();
@@ -49,22 +51,22 @@ public TextAttribute getJsDocAttribute() {
4951 */
5052 private void createRules () {
5153 Token keywordToken = new Token (
52- new TextAttribute (EditorColors .getColor (new RGB (127 , 0 , 85 )), null , SWT .BOLD ));
54+ new TextAttribute (EditorColors .getColor (new RGB (127 , 0 , 85 )), null , SWT .BOLD )); //! hard-coded
5355
5456 commentToken = new Token (commentAttribute );
5557
5658 Token jsDocToken = new Token (jsDocAttribute );
5759
5860 Token stringToken = new Token (
59- new TextAttribute (EditorColors .getColor (new RGB (42 , 0 , 255 )), null , SWT .NORMAL ));
61+ new TextAttribute (EditorColors .getColor (new RGB (42 , 0 , 255 )), null , SWT .NORMAL )); //! hard-coded
6062
6163 RGB blackRgb = new RGB (0 , 0 , 0 );
6264
6365 Token numberToken = new Token (
64- new TextAttribute (EditorColors . getColor ( blackRgb ) , null , SWT .NORMAL ));
66+ new TextAttribute (null , null , SWT .NORMAL )); //EditorColors.getColor(blackRgb) //! hard-coded
6567
6668 Token normalToken = new Token (
67- new TextAttribute (EditorColors . getColor ( blackRgb ) , null , SWT .NORMAL ));
69+ new TextAttribute (null , null , SWT .NORMAL )); //EditorColors.getColor(blackRgb) //! hard-coded
6870 setDefaultReturnToken (normalToken );
6971
7072 setRules (new IRule [] {
@@ -120,6 +122,8 @@ private static class KeywordRule extends WordRule {
120122 "void" , //$NON-NLS-1$
121123 "while" , //$NON-NLS-1$
122124 "with" , //$NON-NLS-1$
125+ //+ @since 0.10
126+ "yield" , //$NON-NLS-1$
123127
124128 // Highlight important qualifiers
125129 "__proto__" , //$NON-NLS-1$
0 commit comments