Ignore:
Timestamp:
2011-02-12T20:30:01+01:00 (13 years ago)
Author:
bastiK
Message:

mapcss: some rework of Error Handling, (Multi)Cascade and icon loading

File:
1 edited

Legend:

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

    r3888 r3893  
    290290{
    291291    boolean not = false;
     292    boolean yes = false;
    292293    String key;
    293294}
     
    295296    ( <EXCLAMATION> { not = true; } )?
    296297    key=string_or_ident()
    297     { return new Condition.KeyCondition(key, not); }
     298    ( <QUESTION> { yes = true; } )?
     299    { return new Condition.KeyCondition(key, not, yes); }
    298300}
    299301
     
    504506JAVACODE
    505507void error_skipto(int kind) {
     508    if (token.kind == EOF)
     509        throw new ParseException("Reached end of file while parsing");
    506510    ParseException e = generateParseException();
    507511    System.err.println("Skipping to the next rule, because of an error:");
    508512    System.err.println(e);
    509513    if (sheet != null) {
    510         sheet.logError(e);
     514        sheet.logError(new ParseException(e.getMessage()));
    511515    }
    512516    Token t;
     
    527531    while (true) {
    528532        t = getNextToken();
     533        if ((t.kind == S || t.kind == STRING || t.kind == UNEXPECTED_CHAR) &&
     534                t.image.contains("\n")) {
     535            ParseException e = new ParseException(String.format("Warning: end of line while reading an unquoted string at line %s column %s.", t.beginLine, t.beginColumn));
     536            System.err.println(e);
     537            if (sheet != null) {
     538                sheet.logError(e);
     539            }
     540        }
    529541        if (t.kind == SEMICOLON || t.kind == EOF)
    530542            break;
Note: See TracChangeset for help on using the changeset viewer.