Skip to content

Commit

Permalink
[lang] Add new function templates for pure functions.
Browse files Browse the repository at this point in the history
The new supported functions names are: `compare`, `compareTo`, `abs`,
`acos`, `asin`, `atan`, `atan2`, `cbrt`, `ceil`, `cos`, `cosh`, `exp`,
`floor`, `hypot`, `log`, `log10`, `log1p`, `max`, `min`, `pow`,
`random`, `rint`, `round`, `scalb`, `signum`, `sin`, `sinh`, `sqrt`,
`tan`, `tanh`, `ulp`.

see #1009

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Jun 9, 2020
1 parent 46bc425 commit 977c84a
Showing 1 changed file with 23 additions and 0 deletions.
Expand Up @@ -44,16 +44,39 @@ public class PureOperationNameValidator implements IPureOperationNameValidator {
* considered as pure.
*/
public static final String[] SPECIAL_PURE_FUNCTION_NAME_PATTERNS = {
"abs", //$NON-NLS-1$
"a?cos", //$NON-NLS-1$
"a?sin", //$NON-NLS-1$
"atan2?", //$NON-NLS-1$
"cbrt", //$NON-NLS-1$
"ceil", //$NON-NLS-1$
"clone", //$NON-NLS-1$
"compare", //$NON-NLS-1$
"compareTo", //$NON-NLS-1$
"contains(?:[A-Z1-9_][a-zA-Z1-9_]*)?", //$NON-NLS-1$
"cosh", //$NON-NLS-1$
"equals", //$NON-NLS-1$
"exp", //$NON-NLS-1$
"floor", //$NON-NLS-1$
"get(?:[A-Z1-9_][a-zA-Z1-9_]*)?", //$NON-NLS-1$
"has[A-Z1-9_][a-zA-Z1-9_]*", //$NON-NLS-1$
"hashCode", //$NON-NLS-1$
"hypot", //$NON-NLS-1$
"is[A-Z1-9_][a-zA-Z1-9_]*", //$NON-NLS-1$
"iterator", //$NON-NLS-1$
"length", //$NON-NLS-1$
"log(?:1[0p])?", //$NON-NLS-1$
"max", //$NON-NLS-1$
"min", //$NON-NLS-1$
"pow", //$NON-NLS-1$
"random", //$NON-NLS-1$
"rint", //$NON-NLS-1$
"round", //$NON-NLS-1$
"si(?:(?:gnum)|(?:nh))", //$NON-NLS-1$
"sqrt", //$NON-NLS-1$
"tanh?", //$NON-NLS-1$
"to[A-Z1-9_][a-zA-Z1-9_]*", //$NON-NLS-1$
"ulp", //$NON-NLS-1$
"size", //$NON-NLS-1$
};

Expand Down

0 comments on commit 977c84a

Please sign in to comment.