Changeset 12695


Ignore:
Timestamp:
Apr 30, 2019 4:46:40 PM (7 months ago)
Author:
tgutzmann
Message:

#5764 Code simplification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/ModelicaFrontEnd/src/java/org/jmodelica/util/QualifiedName.java

    r12694 r12695  
    4848        isUnQualifiedImport = name.endsWith(".*");
    4949        splitQualifiedClassName(name);
    50         this.isGlobal = isGlobal; // Note: must be setter after splitting
     50        this.isGlobal = isGlobal; // Note: must be set after splitting
    5151        iterator = names.iterator();
    5252    }
     
    114114        ModelicaScanner ms = new ModelicaScanner(new StringReader(name));
    115115        try {
    116             Symbol sym = ms.nextToken();
    117             if (sym.getId() != Terminals.ID)
    118                 throw new NameFormatException("The qualified name is not valid");
    119             names.add((String)sym.value);
    120             while ((sym = ms.nextToken()).getId() == Terminals.DOT) {
     116            Symbol sym;
     117            do {
    121118                sym = ms.nextToken();
    122119                if (sym.getId() != Terminals.ID)
    123120                    throw new NameFormatException("The qualified name is not valid");
    124121                names.add((String)sym.value);
    125             }
     122            } while ((sym = ms.nextToken()).getId() == Terminals.DOT);
    126123            if (sym.getId() != Terminals.EOF)
    127124                throw new NameFormatException("Invalid name: " + name);
Note: See TracChangeset for help on using the changeset viewer.