Skip to content

Commit

Permalink
Unicode Math #249 for JAVA + tiny fix described in #252
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszgromada committed Mar 11, 2022
1 parent 96a47a0 commit a3a400d
Show file tree
Hide file tree
Showing 18 changed files with 4,299 additions and 962 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ private void CONSTANT(int pos) {
constValue = AstronomicalConstants.MOON_MASS;
break;
case ConstantValue.MONN_SEMI_MAJOR_AXIS_ID:
constValue = AstronomicalConstants.MONN_SEMI_MAJOR_AXIS;
constValue = AstronomicalConstants.MOON_SEMI_MAJOR_AXIS;
break;
case ConstantValue.SOLAR_RADIUS_ID:
constValue = AstronomicalConstants.SOLAR_RADIUS;
Expand Down Expand Up @@ -4950,11 +4950,7 @@ private bool checkSyntax(String level, bool functionWithBodyExt) {
recursionCallPending = false;
return syntax;
}
#if PCL || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2
syntaxchecker.SyntaxChecker syn = new syntaxchecker.SyntaxChecker(new MemoryStream(Encoding.UTF8.GetBytes(expressionString)));
#else
syntaxchecker.SyntaxChecker syn = new syntaxchecker.SyntaxChecker(new MemoryStream(Encoding.ASCII.GetBytes(expressionString)) );
#endif
syntaxchecker.SyntaxChecker syn = new syntaxchecker.SyntaxChecker(new MemoryStream(Encoding.UTF8.GetBytes(expressionString)));
try {
syn.checkSyntax();
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* @(#)AstronomicalConstants.cs 4.0.0 2017-03-11
* @(#)AstronomicalConstants.cs 5.0.0 2022-02-27
*
* You may use this software under the condition of "Simplified BSD License"
*
* Copyright 2010-2019 MARIUSZ GROMADA. All rights reserved.
* Copyright 2010-2022 MARIUSZ GROMADA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace org.mariuszgromada.math.mxparser.mathcollection {
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="http://scalarmath.org/" target="_blank">ScalarMath.org</a><br>
*
* @version 4.0.0
* @version 5.0.0
*/
[CLSCompliant(true)]
public sealed class AstronomicalConstants {
Expand Down Expand Up @@ -127,7 +127,7 @@ public sealed class AstronomicalConstants {
/**
* Moon semi-major axis
*/
public const double MONN_SEMI_MAJOR_AXIS = 384399 * Units.KILOMETRE;
public const double MOON_SEMI_MAJOR_AXIS = 384399 * Units.KILOMETRE;
/**
* Solar radius
*/
Expand Down
209 changes: 206 additions & 3 deletions CURRENT/java/src/org/mariuszgromada/math/mxparser/Expression.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* @(#)AstronomicalConstants.java 4.0.0 2017-03-11
* @(#)AstronomicalConstants.java 5.0.0 2022-02-27
*
* You may use this software under the condition of "Simplified BSD License"
*
* Copyright 2010-2019 MARIUSZ GROMADA. All rights reserved.
* Copyright 2010-2022 MARIUSZ GROMADA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
Expand Down Expand Up @@ -75,7 +75,7 @@
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="http://scalarmath.org/" target="_blank">ScalarMath.org</a><br>
*
* @version 4.0.0
* @version 5.0.0
*/
public final class AstronomicalConstants {
/**
Expand Down Expand Up @@ -125,7 +125,7 @@ public final class AstronomicalConstants {
/**
* Moon semi-major axis
*/
public static final double MONN_SEMI_MAJOR_AXIS = 384399 * Units.KILOMETRE;
public static final double MOON_SEMI_MAJOR_AXIS = 384399 * Units.KILOMETRE;
/**
* Solar radius
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* @(#)BinaryRelation.java 4.1.0 2017-05-13
* @(#)BinaryRelation.java 5.0.0 2022-03-05
*
* You may use this software under the condition of "Simplified BSD License"
*
* Copyright 2010-2017 MARIUSZ GROMADA. All rights reserved.
* Copyright 2010-2022 MARIUSZ GROMADA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
Expand Down Expand Up @@ -76,7 +76,7 @@
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="http://scalarmath.org/" target="_blank">ScalarMath.org</a><br>
*
* @version 4.1.0
* @version 5.0.0
*/
public final class BinaryRelation {
/*
Expand All @@ -99,24 +99,34 @@ public final class BinaryRelation {
public static final String EQ_STR = "=";
public static final String EQ1_STR = "==";
public static final String NEQ_STR = "<>";
public static final String NEQ_STR_UNI_1 = "≠";
public static final String NEQ1_STR = "~=";
public static final String NEQ2_STR = "!=";
public static final String LT_STR = "<";
public static final String GT_STR = ">";
public static final String LEQ_STR = "<=";
public static final String LEQ_STR_UNI_1 = "≤";
public static final String LEQ_STR_UNI_2 = "⋜";
public static final String GEQ_STR = ">=";
public static final String GEQ_STR_UNI_1 = "≥";
public static final String GEQ_STR_UNI_2 = "⋝";
/*
* BinaryRelation - syntax.
*/
public static final String EQ_SYN = "a = b";
public static final String EQ1_SYN = "a == b";
public static final String NEQ_SYN = "a <> b";
public static final String NEQ_SYN_UNI_1 = "a ≠ b";
public static final String NEQ1_SYN = "a ~= b";
public static final String NEQ2_SYN = "a != b";
public static final String LT_SYN = "a < b";
public static final String GT_SYN = "a > b";
public static final String LEQ_SYN = "a <= b";
public static final String LEQ_SYN_UNI_1 = "a ≤ b";
public static final String LEQ_SYN_UNI_2 = "a ⋝ b";
public static final String GEQ_SYN = "a >= b";
public static final String GEQ_SYN_UNI_1 = "a ≥ b";
public static final String GEQ_SYN_UNI_2 = "a ⋝ b";
/*
* BinaryRelation - tokens description.
*/
Expand All @@ -131,8 +141,13 @@ public final class BinaryRelation {
*/
public static final String EQ_SINCE = mXparser.NAMEv10;
public static final String NEQ_SINCE = mXparser.NAMEv10;
public static final String NEQ_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String LT_SINCE = mXparser.NAMEv10;
public static final String GT_SINCE = mXparser.NAMEv10;
public static final String LEQ_SINCE = mXparser.NAMEv10;
public static final String LEQ_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String LEQ_SINCE_UNI_2 = mXparser.NAMEv50;
public static final String GEQ_SINCE = mXparser.NAMEv10;
public static final String GEQ_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String GEQ_SINCE_UNI_2 = mXparser.NAMEv50;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* @(#)BooleanOperator.java 4.1.0 2017-05-13
* @(#)BooleanOperator.java 5.0.0 2022-02-26
*
* You may use this software under the condition of "Simplified BSD License"
*
* Copyright 2010-2017 MARIUSZ GROMADA. All rights reserved.
* Copyright 2010-2022 MARIUSZ GROMADA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
Expand Down Expand Up @@ -76,7 +76,7 @@
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="http://scalarmath.org/" target="_blank">ScalarMath.org</a><br>
*
* @version 4.1.0
* @version 5.0.0
*/
public final class BooleanOperator {
/*
Expand All @@ -102,46 +102,88 @@ public final class BooleanOperator {
* BooleanOperator - tokens key words.
*/
public static final String NEG_STR = "~";
public static final String NEG_STR_UNI_1 = "¬";
public static final String AND_STR = "&";
public static final String AND_STR_UNI_1 = "∧";
public static final String AND1_STR = "&&";
public static final String AND2_STR = "/\\";
public static final String NAND_STR = NEG_STR + AND_STR;
public static final String NAND1_STR = NEG_STR + AND1_STR;
public static final String NAND2_STR = NEG_STR + AND2_STR;
public static final String NAND_STR_UNI_1 = NEG_STR + AND_STR_UNI_1;
public static final String NAND_STR_UNI_2 = NEG_STR_UNI_1 + AND_STR;
public static final String NAND_STR_UNI_3 = NEG_STR_UNI_1 + AND1_STR;
public static final String NAND_STR_UNI_4 = NEG_STR_UNI_1 + AND2_STR;
public static final String NAND_STR_UNI_5 = NEG_STR_UNI_1 + AND_STR_UNI_1;
public static final String NAND_STR_UNI_6 = "⊼";
public static final String OR_STR = "|";
public static final String OR_STR_UNI_1 = "∨";
public static final String OR1_STR = "||";
public static final String OR2_STR = "\\/";
public static final String NOR_STR = NEG_STR + OR_STR;
public static final String NOR1_STR = NEG_STR + OR1_STR;
public static final String NOR2_STR = NEG_STR + OR2_STR;
public static final String NOR_STR_UNI_1 = NEG_STR + OR_STR_UNI_1;
public static final String NOR_STR_UNI_2 = NEG_STR_UNI_1 + OR_STR;
public static final String NOR_STR_UNI_3 = NEG_STR_UNI_1 + OR1_STR;
public static final String NOR_STR_UNI_4 = NEG_STR_UNI_1 + OR2_STR;
public static final String NOR_STR_UNI_5 = NEG_STR_UNI_1 + OR_STR_UNI_1;
public static final String NOR_STR_UNI_6 = "⊽";
public static final String XOR_STR = "(+)";
public static final String XOR_STR_UNI_1 = "⊻";
public static final String IMP_STR = "-->";
public static final String IMP_STR_UNI_1 = "⇒";
public static final String CIMP_STR = "<--";
public static final String CIMP_STR_UNI_1 = "⇐";
public static final String NIMP_STR = "-/>";
public static final String NIMP_STR_UNI_1 = "⇏";
public static final String CNIMP_STR = "</-";
public static final String CNIMP_STR_UNI_1 = "⇍";
public static final String EQV_STR = "<->";
public static final String EQV_STR_UNI_1 = "⇔";
/*
* BooleanOperator - syntax.
*/
public static final String NEG_SYN = "~p";
public static final String NEG_SYN_UNI_1 = "¬p";
public static final String AND_SYN = "p & q";
public static final String AND1_SYN = "p && q";
public static final String AND2_SYN = "p /\\ q";
public static final String NAND_SYN = "p " + NEG_STR + AND_STR + " q";
public static final String NAND1_SYN = "p " + NEG_STR + AND1_STR + " q";
public static final String NAND2_SYN = "p " + NEG_STR + AND2_STR + " q";
public static final String AND_SYN_UNI_1 = "p ∧ q";
public static final String NAND_SYN = "p " + NAND_STR + " q";
public static final String NAND1_SYN = "p " + NAND1_STR + " q";
public static final String NAND2_SYN = "p " + NAND2_STR + " q";
public static final String NAND_SYN_UNI_1 = "p " + NAND_STR_UNI_1 + " q";
public static final String NAND_SYN_UNI_2 = "p " + NAND_STR_UNI_2 + " q";
public static final String NAND_SYN_UNI_3 = "p " + NAND_STR_UNI_3 + " q";
public static final String NAND_SYN_UNI_4 = "p " + NAND_STR_UNI_4 + " q";
public static final String NAND_SYN_UNI_5 = "p " + NAND_STR_UNI_5 + " q";
public static final String NAND_SYN_UNI_6 = "p " + NAND_STR_UNI_6 + " q";
public static final String OR_SYN = "p | q";
public static final String OR1_SYN = "p || q";
public static final String OR2_SYN = "p \\/ q";
public static final String NOR_SYN = "p " + NEG_STR + OR_STR + " q";
public static final String NOR1_SYN = "p " + NEG_STR + OR1_STR + " q";
public static final String NOR2_SYN = "p " + NEG_STR + OR2_STR + " q";
public static final String OR_SYN_UNI_1 = "p ∨ q";
public static final String NOR_SYN = "p " + NOR_STR + " q";
public static final String NOR1_SYN = "p " + NOR1_STR + " q";
public static final String NOR2_SYN = "p " + NOR2_STR + " q";
public static final String NOR_SYN_UNI_1 = "p " + NOR_STR_UNI_1 + " q";
public static final String NOR_SYN_UNI_2 = "p " + NOR_STR_UNI_2 + " q";
public static final String NOR_SYN_UNI_3 = "p " + NOR_STR_UNI_3 + " q";
public static final String NOR_SYN_UNI_4 = "p " + NOR_STR_UNI_4 + " q";
public static final String NOR_SYN_UNI_5 = "p " + NOR_STR_UNI_5 + " q";
public static final String NOR_SYN_UNI_6 = "p " + NOR_STR_UNI_6 + " q";
public static final String XOR_SYN = "p (+) q";
public static final String XOR_SYN_UNI_1 = "p ⊻ q";
public static final String IMP_SYN = "p --> q";
public static final String IMP_SYN_UNI_1 = "p ⇒ q";
public static final String CIMP_SYN = "p <-- q";
public static final String NIMP_SYN = "p -/> q";
public static final String CIMP_SYN_UNI_1 = "p ⇐ q";
public static final String NIMP_SYN = "p -/> q";
public static final String NIMP_SYN_UNI_1 = "p ⇏ q";
public static final String CNIMP_SYN = "p </- q";
public static final String CNIMP_SYN_UNI_1 = "p ⇍ q";
public static final String EQV_SYN = "p <-> q";
public static final String EQV_SYN_UNI_1 = "p ⇔ q";
/*
* BooleanOperator - tokens description.
*/
Expand All @@ -160,14 +202,35 @@ public final class BooleanOperator {
* BooleanOperator - since.
*/
public static final String AND_SINCE = mXparser.NAMEv10;
public static final String AND_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String OR_SINCE = mXparser.NAMEv10;
public static final String OR_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String NEG_SINCE = mXparser.NAMEv10;
public static final String NEG_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String NAND_SINCE = mXparser.NAMEv10;
public static final String NAND_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String NAND_SINCE_UNI_2 = mXparser.NAMEv50;
public static final String NAND_SINCE_UNI_3 = mXparser.NAMEv50;
public static final String NAND_SINCE_UNI_4 = mXparser.NAMEv50;
public static final String NAND_SINCE_UNI_5 = mXparser.NAMEv50;
public static final String NAND_SINCE_UNI_6 = mXparser.NAMEv50;
public static final String NOR_SINCE = mXparser.NAMEv10;
public static final String NOR_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String NOR_SINCE_UNI_2 = mXparser.NAMEv50;
public static final String NOR_SINCE_UNI_3 = mXparser.NAMEv50;
public static final String NOR_SINCE_UNI_4 = mXparser.NAMEv50;
public static final String NOR_SINCE_UNI_5 = mXparser.NAMEv50;
public static final String NOR_SINCE_UNI_6 = mXparser.NAMEv50;
public static final String XOR_SINCE = mXparser.NAMEv10;
public static final String XOR_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String IMP_SINCE = mXparser.NAMEv10;
public static final String IMP_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String CIMP_SINCE = mXparser.NAMEv10;
public static final String CIMP_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String NIMP_SINCE = mXparser.NAMEv10;
public static final String NIMP_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String CNIMP_SINCE = mXparser.NAMEv10;
public static final String CNIMP_SINCE_UNI_1 = mXparser.NAMEv50;
public static final String EQV_SINCE = mXparser.NAMEv10;
public static final String EQV_SINCE_UNI_1 = mXparser.NAMEv50;
}
Loading

0 comments on commit a3a400d

Please sign in to comment.