Merge branch 'VfParserTabSize' of https://github.com/sgorbaty/pmd into pr-288

This commit is contained in:
Andreas Dangel
2017-03-11 16:02:48 +01:00
3 changed files with 26 additions and 5 deletions

View File

@ -14,7 +14,6 @@ import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.AbstractTokenManager; import net.sourceforge.pmd.lang.ast.AbstractTokenManager;
import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.ParseException;
import net.sourceforge.pmd.lang.ast.SimpleCharStream;
/** /**
* Adapter for the VfParser. * Adapter for the VfParser.
@ -36,7 +35,7 @@ public class VfParser extends AbstractParser {
public Node parse(String fileName, Reader source) throws ParseException { public Node parse(String fileName, Reader source) throws ParseException {
AbstractTokenManager.setFileName(fileName); AbstractTokenManager.setFileName(fileName);
return new net.sourceforge.pmd.lang.vf.ast.VfParser(new SimpleCharStream(source)).CompilationUnit(); return new net.sourceforge.pmd.lang.vf.ast.VfParser(new VfSimpleCharStream(source)).CompilationUnit();
} }
public Map<Integer, String> getSuppressMap() { public Map<Integer, String> getSuppressMap() {

View File

@ -0,0 +1,22 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.vf;
import java.io.Reader;
import net.sourceforge.pmd.lang.ast.SimpleCharStream;
/**
* @author sergey.gorbaty
*
*/
public class VfSimpleCharStream extends SimpleCharStream {
public VfSimpleCharStream(Reader dstream) {
super(dstream);
tabSize = 4;
}
}

View File

@ -136,9 +136,9 @@ Has multiple resources but starts with a safe one
]]></description> ]]></description>
<expected-problems>0</expected-problems> <expected-problems>0</expected-problems>
<code><![CDATA[ <code><![CDATA[
<apex:page> <apex:page>
<link rel="stylesheet" type="text/css" href="{!$Resource.SDEFExtJS}/{!anotherRes}" id="ext-all-css"/> <link rel="stylesheet" type="text/css" href="{!$Resource.SDEFExtJS}/{!anotherRes}" id="ext-all-css"/>
</apex:page> </apex:page>
]]></code> ]]></code>
<source-type>vf</source-type> <source-type>vf</source-type>
</test-code> </test-code>