Ignore:
Timestamp:
2014-05-04T12:55:06+02:00 (12 years ago)
Author:
bastiK
Message:

reverting [7056] because it won't work for execution in multiple threads (which will be more useful)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r7056 r7057  
    1818import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
    1919import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
    20 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule.Declaration;
    2120import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    2221import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
     
    470469void sheet(MapCSSStyleSource sheet):
    471470{
     471    MapCSSRule r;
    472472}
    473473{
     
    476476    (
    477477        try {
    478             rule() w()
     478            r=rule() { if (r != null) { sheet.rules.add(r); } } w()
    479479        } catch (MapCSSException mex) {
    480480            error_skipto(RBRACE, mex);
     
    488488}
    489489
    490 void rule():
     490MapCSSRule rule():
    491491{
    492492    List<Selector> selectors = new ArrayList<Selector>();
    493493    Selector sel;
    494     Declaration decl;
     494    List<Instruction> decl;
    495495}
    496496{
     
    501501    )*
    502502    decl=declaration()
    503     {
    504         for (Selector s : selectors) {
    505             sheet.rules.add(new MapCSSRule(s, decl));
    506         }
    507     }
     503    { return new MapCSSRule(selectors, decl); }
    508504}
    509505
     
    711707}
    712708
    713 Declaration declaration() :
     709List<Instruction> declaration() :
    714710{
    715711    List<Instruction> ins = new ArrayList<Instruction>();
     
    727723            ( <EQUAL> val=expression() )?
    728724            { ins.add(new Instruction.AssignmentInstruction(key.image, val == null ? true : val, true)); }
    729             ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )
     725            ( <RBRACE> { return ins; } | <SEMICOLON> w() )
    730726        )
    731727    |
     
    736732                { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); }
    737733                w()
    738                 ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )
     734                ( <RBRACE> { return ins; } | <SEMICOLON> w() )
    739735            |
    740736            LOOKAHEAD( expression() ( <SEMICOLON> | <RBRACE> ) )
    741737                val=expression()
    742738                { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); }
    743                 ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )
     739                ( <RBRACE> { return ins; } | <SEMICOLON> w() )
    744740            |
    745741                val=readRaw() w() { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); }
     
    747743    )*
    748744    <RBRACE>
    749     { return new Declaration(ins); }
     745    { return ins; }
    750746}
    751747
Note: See TracChangeset for help on using the changeset viewer.