Changeset 06f4d98e in OpenModelica


Ignore:
Timestamp:
2013-02-26T11:15:41+01:00 (11 years ago)
Author:
Daniel Hedberg <daniel@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
fea78539
Parents:
a81e91aa
Message:

Fixed bugs in unparsing of enumeration literals:

  • Allow enumerations with only one enumerator/literal.
  • Do not print a space after last literal if no comment is available.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15328 f25d12d1-65f4-0310-ae8a-bbce733d8d8e

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/FrontEnd/Dump.mo

    rfb23d276 r06f4d98e  
    497497  outString := matchcontinue (inAbsynEnumLiteralLst)
    498498    local
    499       Ident s1,s2,res,str,str2;
    500       Option<Absyn.Comment> optcmt,optcmt2;
     499      Ident s1,s2,res,str;
     500      Option<Absyn.Comment> optcmt;
    501501      Absyn.EnumLiteral a;
    502502      list<Absyn.EnumLiteral> b;
     
    512512        res;
    513513   
    514     case ({Absyn.ENUMLITERAL(literal = str,comment = optcmt),Absyn.ENUMLITERAL(literal = str2,comment = optcmt2)})
     514    case ({Absyn.ENUMLITERAL(literal = str,comment = NONE())}) then str;
     515    case ({Absyn.ENUMLITERAL(literal = str,comment = optcmt as SOME(_))})
    515516      equation
    516517        s1 = unparseCommentOption(optcmt);
    517         s2 = unparseCommentOption(optcmt2);
    518         res = stringAppendList({str," ",s1,", ",str2," ",s2});
     518        res = stringAppendList({str," ",s1});
    519519      then
    520520        res;
    521   end matchcontinue;
     521
     522    end matchcontinue;
    522523end unparseEnumliterals;
    523524
Note: See TracChangeset for help on using the changeset viewer.