/** * Returns whether the current programming language uses curly braces * ('<code>{</code>' and '<code>}</code>') to denote code blocks. * * @param languageIndex The language index at the offset in question. * Since some <code>TokenMaker</code>s effectively have nested * languages (such as JavaScript in HTML), this parameter tells the * <code>TokenMaker</code> what sub-language to look at. * @return Whether curly braces denote code blocks. */ public boolean getCurlyBracesDenoteCodeBlocks(int languageIndex) { return tokenMaker.getCurlyBracesDenoteCodeBlocks(languageIndex); }
@Test public void testCss_getCurlyBracesDenoteCodeBlocks() { TokenMaker tm = createTokenMaker(); Assert.assertTrue(tm.getCurlyBracesDenoteCodeBlocks(0)); }
@Test public void testCss_getCurlyBracesDenoteCodeBlocks() { TokenMaker tm = createTokenMaker(); Assert.assertTrue(tm.getCurlyBracesDenoteCodeBlocks(0)); }
/** * Returns whether the current programming language uses curly braces * ('<tt>{</tt>' and '<tt>}</tt>') to denote code blocks. * * @return Whether curly braces denote code blocks. */ public boolean getCurlyBracesDenoteCodeBlocks() { return tokenMaker.getCurlyBracesDenoteCodeBlocks(); }
@Test public void testGetCurlyBracesDenoteCodeBlocks() { // Language that does use curly braces String syntaxStyle = SyntaxConstants.SYNTAX_STYLE_C; doc = new RSyntaxDocument(syntaxStyle); TokenMaker tokenMaker = new CTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); // Language that does not use curly braces syntaxStyle = SyntaxConstants.SYNTAX_STYLE_XML; doc.setSyntaxStyle(syntaxStyle); tokenMaker = new XMLTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); // Language in which some sub-languages do, some don't syntaxStyle = SyntaxConstants.SYNTAX_STYLE_HTML; doc.setSyntaxStyle(syntaxStyle); tokenMaker = new HTMLTokenMaker(); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(0), doc.getCurlyBracesDenoteCodeBlocks(0)); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(1), doc.getCurlyBracesDenoteCodeBlocks(1)); Assert.assertEquals(tokenMaker.getCurlyBracesDenoteCodeBlocks(2), doc.getCurlyBracesDenoteCodeBlocks(2)); // Sanity Assert.assertFalse(tokenMaker.getCurlyBracesDenoteCodeBlocks(0)); Assert.assertTrue(tokenMaker.getCurlyBracesDenoteCodeBlocks(1)); Assert.assertTrue(tokenMaker.getCurlyBracesDenoteCodeBlocks(2)); }
/** * Returns whether the current programming language uses curly braces * ('<tt>{</tt>' and '<tt>}</tt>') to denote code blocks. * * @return Whether curly braces denote code blocks. */ public boolean getCurlyBracesDenoteCodeBlocks() { return tokenMaker.getCurlyBracesDenoteCodeBlocks(); }
/** * Returns whether the current programming language uses curly braces * ('<code>{</code>' and '<code>}</code>') to denote code blocks. * * @param languageIndex The language index at the offset in question. * Since some <code>TokenMaker</code>s effectively have nested * languages (such as JavaScript in HTML), this parameter tells the * <code>TokenMaker</code> what sub-language to look at. * @return Whether curly braces denote code blocks. */ public boolean getCurlyBracesDenoteCodeBlocks(int languageIndex) { return tokenMaker.getCurlyBracesDenoteCodeBlocks(languageIndex); }