From 74424e66c96cd95bceff934aeaf15877fd62857c Mon Sep 17 00:00:00 2001 From: Anton Haumer Date: Fri, 2 Feb 2024 10:10:04 +0100 Subject: [PATCH] Merge pull request #4275 from maltelenz/bugfix/reference-syntax Fix syntax errors in ModelicaReference documentation snippets --- ModelicaReference/package.mo | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ModelicaReference/package.mo b/ModelicaReference/package.mo index 286bc76847..e049ea2ee8 100644 --- a/ModelicaReference/package.mo +++ b/ModelicaReference/package.mo @@ -1980,7 +1980,7 @@ Example of function partial application as argument, positional argument passing input Real A; input Real w; algorithm - y:=A*Modelica.Math.sin(w*x); + y := A*Modelica.Math.sin(w*x); end Sine; //Call with function partial application as named input argument: @@ -2000,7 +2000,7 @@ application: input Real x; // Note: x is now last in argument list. output Real y; algorithm - y:=A*Modelica.Math.sin(w*x); + y := A*Modelica.Math.sin(w*x); end Sine2; // The partially evaluated Sine2 has only one argument: @@ -2041,7 +2041,7 @@ a component, according to case (d) above: algorithm // Case (b) and (c) integral := quadrature(x1, x2, - function quadratureOnce(y1=y1, y2=y2, integrand=integrand); + function quadratureOnce(y1=y1, y2=y2, integrand=integrand)); end surfaceQuadrature; ")); @@ -2085,7 +2085,7 @@ Define specialized class function input Real x; output Real y; algorithm - y = if abs(x) < Modelica.Constants.eps then 1 else Modelica.Math.sin(x)/x; + y := if abs(x) < Modelica.Constants.eps then 1 else Modelica.Math.sin(x)/x; end si;
@@ -2207,7 +2207,7 @@ can also have an optional functional default value. Example: // With default: input Integrand integrand := Modelica.Math.sin; output Real integral; algorithm - integral :=(x2-x1)*(integrand(x1) + integrand(x2))/2; + integral := (x2-x1)*(integrand(x1) + integrand(x2))/2; end quadrature; partial function Integrand @@ -2238,7 +2238,7 @@ to the corresponding formal parameter of function type. Example: function Parabola extends Integrand; algorithm - y = x*x; + y := x*x; end Parabola; area = quadrature(0, 1, Parabola);