Changeset 8331 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-05-05T22:08:03+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r8318 r8331 8 8 import java.io.InputStream; 9 9 import java.io.Reader; 10 import java.io.StringReader; 10 11 import java.text.MessageFormat; 11 12 import java.util.ArrayList; … … 317 318 static List<TagCheck> readMapCSS(Reader css) throws ParseException { 318 319 CheckParameterUtil.ensureParameterNotNull(css, "css"); 319 return readMapCSS(new MapCSSParser(css)); 320 } 321 322 static List<TagCheck> readMapCSS(MapCSSParser css) throws ParseException { 323 CheckParameterUtil.ensureParameterNotNull(css, "css"); 320 324 321 final MapCSSStyleSource source = new MapCSSStyleSource(""); 325 css.sheet(source); 322 final MapCSSParser preprocessor = new MapCSSParser(css, MapCSSParser.LexicalState.PREPROCESSOR); 323 324 css = new StringReader(preprocessor.pp_root(source)); 325 final MapCSSParser parser = new MapCSSParser(css, MapCSSParser.LexicalState.DEFAULT); 326 parser.sheet(source); 326 327 assert source.getErrors().isEmpty(); 327 328 // Ignore "meta" rule(s) from external rules of JOSM wiki -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r8260 r8331 9 9 10 10 import java.io.InputStream; 11 import java.io.Reader; 11 12 import java.util.ArrayList; 12 13 import java.util.Arrays; … … 87 88 throw new RuntimeException(e); 88 89 } 90 return new MapCSSParserTokenManager(scs, initState.idx); 91 } 92 93 /** 94 * Constructor which initializes the parser with a certain lexical state. 95 */ 96 public MapCSSParser(Reader in, LexicalState initState) { 97 this(createTokenManager(in, initState)); 98 declarationCounter = 0; 99 } 100 101 protected static MapCSSParserTokenManager createTokenManager(Reader in, LexicalState initState) { 102 final SimpleCharStream scs = new SimpleCharStream(in, 1, 1); 89 103 return new MapCSSParserTokenManager(scs, initState.idx); 90 104 }
Note:
See TracChangeset
for help on using the changeset viewer.