Changeset 9aa66d0 in OpenModelica


Ignore:
Timestamp:
2022-05-17T14:08:54+02:00 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master
Children:
d1015711
Parents:
b7b3c97
git-author:
perost <perost86@…> (05/17/22 14:08:54)
git-committer:
GitHub <noreply@…> (05/17/22 14:08:54)
Message:

Remove Call.getLastPathName (#8971)

  • Remove Call.getLastPathName since it's just a copy of AbsynUtil.pathLastIdent and doesn't really belong in Call.
Location:
OMCompiler/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/NBackEnd/Modules/2_Pre/NBEvents.mo

    r9fb3a7d r9aa66d0  
    4848  import Expression = NFExpression;
    4949  import NFFlatten.FunctionTreeImpl;
    50   import NFFunction.Function;
    5150  import Operator = NFOperator;
    5251  import Prefixes = NFPrefixes;
     
    729728      local
    730729        Bucket bucket;
    731         Function fn;
    732730
    733731      // logical binarys: e.g. (a and b)
     
    745743
    746744      // sample functions
    747       case Expression.CALL(call = Call.TYPED_CALL(fn = fn)) guard(Call.getLastPathName(fn.path) == "sample") algorithm
     745      case Expression.CALL() guard(Call.isNamed(exp.call, "sample")) algorithm
    748746        (exp, bucket) := collectEventsCondition(exp, Pointer.access(bucket_ptr), eqn_ptr);
    749747        Pointer.update(bucket_ptr, bucket);
  • OMCompiler/Compiler/NBackEnd/Util/NBDifferentiate.mo

    rc08d0b7 r9aa66d0  
    903903      // try some simple known cases
    904904      case (Expression.CALL()) algorithm
    905         ret := match Call.getLastPathName(Call.functionName(exp.call))
     905        ret := match Call.functionNameLast(exp.call)
    906906          case "sample" then Expression.BOOLEAN(false);
    907907          else fail();
  • OMCompiler/Compiler/NFFrontEnd/NFCall.mo

    r4cb8721 r9aa66d0  
    589589  end functionName;
    590590
     591  function functionNameLast
     592    input Call call;
     593    output String ident = AbsynUtil.pathLastIdent(functionName(call));
     594  end functionNameLast;
     595
     596  function functionNameFirst
     597    input Call call;
     598    output String ident = AbsynUtil.pathFirstIdent(functionName(call));
     599  end functionNameFirst;
     600
    591601  function isNamed
    592602    input Call call;
     
    19171927
    19181928      case Call.UNTYPED_CALL(arguments = args)
    1919       then (ComponentRef.firstName(call.ref), args);
     1929        then (ComponentRef.firstName(call.ref), args);
    19201930
    19211931      case Call.TYPED_CALL(fn = fn, arguments = args)
    1922       then (getLastPathName(fn.path), args);
     1932        then (AbsynUtil.pathLastIdent(fn.path), args);
    19231933
    19241934      else algorithm
     
    19271937    end match;
    19281938  end getNameAndArgs;
    1929 
    1930   function getLastPathName
    1931     input Absyn.Path path;
    1932     output String name;
    1933   algorithm
    1934     name := match path
    1935       case Absyn.IDENT()          then path.name;
    1936       case Absyn.QUALIFIED()      then getLastPathName(path.path);
    1937       case Absyn.FULLYQUALIFIED() then getLastPathName(path.path);
    1938       else algorithm
    1939         Error.assertion(false, getInstanceName() + " failed.", sourceInfo());
    1940       then fail();
    1941     end match;
    1942   end getLastPathName;
    19431939
    19441940protected
Note: See TracChangeset for help on using the changeset viewer.