package org.javarosa.xpath.expr;

import org.javarosa.core.model.condition.EvaluationContext;
import org.javarosa.core.model.instance.DataInstance;
import org.javarosa.xpath.parser.XPathSyntaxException;

public class XPathPiFunc extends XPathFuncExpr {
    public static final String NAME = "pi";
    private static final int EXPECTED_ARG_COUNT = 0;

    public XPathPiFunc() {
        name = NAME;
        expectedArgCount = EXPECTED_ARG_COUNT;
    }

    public XPathPiFunc(XPathExpression[] args) throws XPathSyntaxException {
        super(NAME, args, EXPECTED_ARG_COUNT, false);
    }

    @Override
    public Object evalBody(DataInstance model, EvaluationContext evalContext) {
        return Math.PI;
    }

    @Override
    public String getDocumentation() {
        return "";
    }
}

@@ -781,12 +781,172 @@
 urn 
-%22
+getDocHeader()%0A                + %22Behavior: Returns Pi%5Cn%22%0A                + %22Return: Pi%5Cn%22%0A                + %22Arguments: None%5Cn%22%0A                + %22Syntax: pi()
 %22;%0A
+%0A
     

Document the pi func