Changeset 9aa66d0 in OpenModelica
- Timestamp:
- 2022-05-17T14:08:54+02:00 (2 years ago)
- 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)
- Location:
- OMCompiler/Compiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NBackEnd/Modules/2_Pre/NBEvents.mo
r9fb3a7d r9aa66d0 48 48 import Expression = NFExpression; 49 49 import NFFlatten.FunctionTreeImpl; 50 import NFFunction.Function;51 50 import Operator = NFOperator; 52 51 import Prefixes = NFPrefixes; … … 729 728 local 730 729 Bucket bucket; 731 Function fn;732 730 733 731 // logical binarys: e.g. (a and b) … … 745 743 746 744 // sample functions 747 case Expression.CALL( call = Call.TYPED_CALL(fn = fn)) guard(Call.getLastPathName(fn.path) == "sample") algorithm745 case Expression.CALL() guard(Call.isNamed(exp.call, "sample")) algorithm 748 746 (exp, bucket) := collectEventsCondition(exp, Pointer.access(bucket_ptr), eqn_ptr); 749 747 Pointer.update(bucket_ptr, bucket); -
OMCompiler/Compiler/NBackEnd/Util/NBDifferentiate.mo
rc08d0b7 r9aa66d0 903 903 // try some simple known cases 904 904 case (Expression.CALL()) algorithm 905 ret := match Call. getLastPathName(Call.functionName(exp.call))905 ret := match Call.functionNameLast(exp.call) 906 906 case "sample" then Expression.BOOLEAN(false); 907 907 else fail(); -
OMCompiler/Compiler/NFFrontEnd/NFCall.mo
r4cb8721 r9aa66d0 589 589 end functionName; 590 590 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 591 601 function isNamed 592 602 input Call call; … … 1917 1927 1918 1928 case Call.UNTYPED_CALL(arguments = args) 1919 then (ComponentRef.firstName(call.ref), args);1929 then (ComponentRef.firstName(call.ref), args); 1920 1930 1921 1931 case Call.TYPED_CALL(fn = fn, arguments = args) 1922 then (getLastPathName(fn.path), args);1932 then (AbsynUtil.pathLastIdent(fn.path), args); 1923 1933 1924 1934 else algorithm … … 1927 1937 end match; 1928 1938 end getNameAndArgs; 1929 1930 function getLastPathName1931 input Absyn.Path path;1932 output String name;1933 algorithm1934 name := match path1935 case Absyn.IDENT() then path.name;1936 case Absyn.QUALIFIED() then getLastPathName(path.path);1937 case Absyn.FULLYQUALIFIED() then getLastPathName(path.path);1938 else algorithm1939 Error.assertion(false, getInstanceName() + " failed.", sourceInfo());1940 then fail();1941 end match;1942 end getLastPathName;1943 1939 1944 1940 protected
Note: See TracChangeset
for help on using the changeset viewer.