Permalink
Browse files

Changes to is,always,type

  • Loading branch information...
neilellis committed Sep 26, 2017
1 parent c354f7f commit f0d22af06a1888ae0e12042edf936030e8fc7e64
Showing with 479 additions and 296 deletions.
  1. +4 −4 dollar-core/src/main/java/dollar/api/DollarException.java
  2. +2 −2 dollar-core/src/main/java/dollar/api/DollarStatic.java
  3. +3 −3 dollar-core/src/main/java/dollar/api/Scope.java
  4. +4 −0 dollar-core/src/main/java/dollar/api/VarKey.java
  5. +3 −3 dollar-core/src/main/java/dollar/api/exceptions/DollarFailureException.java
  6. +1 −1 dollar-core/src/main/java/dollar/api/exceptions/LambdaRecursionException.java
  7. +1 −1 dollar-core/src/main/java/dollar/api/exceptions/ValidationException.java
  8. +1 −1 dollar-core/src/main/java/dollar/api/scripting/ScriptingLanguage.java
  9. +1 −1 dollar-core/src/main/java/dollar/api/scripting/ScriptingSupport.java
  10. +4 −4 dollar-core/src/main/java/dollar/api/types/DollarFactory.java
  11. +80 −77 dollar-docs/src/main/resources/pages/manual.md
  12. +1 −1 dollar-examples/src/main/resources/negative/neg_constraints_1.ds
  13. +1 −1 dollar-examples/src/main/resources/negative/neg_is_1.ds
  14. +3 −3 dollar-examples/src/main/resources/negative/neg_types_1.ds
  15. +8 −8 dollar-examples/src/main/resources/quick/test_date.ds
  16. +27 −27 dollar-examples/src/main/resources/quick/test_numeric.ds
  17. +8 −8 dollar-examples/src/main/resources/quick/test_ranges.ds
  18. +2 −2 dollar-examples/src/main/resources/quick/test_reactive4.ds
  19. +1 −1 dollar-examples/src/main/resources/quick/test_reactive7.ds
  20. +3 −3 dollar-examples/src/main/resources/quick/test_variables3.ds
  21. +148 −6 dollar-examples/src/test/java/dollar/internal/runtime/script/ParserQuickTest.java
  22. +3 −0 dollar-examples/src/test/java/dollar/internal/runtime/script/ParserSlowTest.java
  23. +1 −1 dollar-plugins/dollar-java-plugin/src/main/java/dollar/java/Java9ScriptingLanguage.java
  24. +48 −26 dollar-script/src/main/java/dollar/internal/runtime/script/DollarUtilFactory.java
  25. +11 −4 dollar-script/src/main/java/dollar/internal/runtime/script/ErrorHandlerFactory.java
  26. +2 −0 dollar-script/src/main/java/dollar/internal/runtime/script/api/DollarUtil.java
  27. +2 −2 dollar-script/src/main/java/dollar/internal/runtime/script/api/ParserErrorHandler.java
  28. +1 −1 ...-script/src/main/java/dollar/internal/runtime/script/api/exceptions/BuiltinNotFoundException.java
  29. +2 −2 ...-script/src/main/java/dollar/internal/runtime/script/api/exceptions/DollarAssertionException.java
  30. +4 −4 dollar-script/src/main/java/dollar/internal/runtime/script/api/exceptions/DollarScriptException.java
  31. +1 −1 ...ipt/src/main/java/dollar/internal/runtime/script/api/exceptions/DollarScriptFailureException.java
  32. +2 −2 dollar-script/src/main/java/dollar/internal/runtime/script/api/exceptions/PureFunctionException.java
  33. +1 −1 dollar-script/src/main/java/dollar/internal/runtime/script/api/exceptions/SyntaxException.java
  34. +13 −6 dollar-script/src/main/java/dollar/internal/runtime/script/parser/SourceNode.java
  35. +9 −17 dollar-script/src/main/java/dollar/internal/runtime/script/parser/Symbols.java
  36. +29 −30 dollar-script/src/main/java/dollar/internal/runtime/script/parser/scope/ScriptScope.java
  37. +1 −1 dollar-script/src/main/java/dollar/main/ParserMain.java
  38. +1 −0 dollar-script/src/main/resources/examples/op/{assert-equals-reactive.ds → always.ds}
  39. 0 dollar-script/src/main/resources/examples/op/{assert-equals-reactive.md → always.md}
  40. +0 −1 dollar-script/src/main/resources/examples/op/assert-equals.ds
  41. +0 −1 dollar-script/src/main/resources/examples/op/assert-equals.md
  42. +2 −2 dollar-script/src/main/resources/examples/op/assign.ds
  43. +4 −4 dollar-script/src/main/resources/examples/op/collect.ds
  44. +5 −5 dollar-script/src/main/resources/examples/op/divide.ds
  45. +1 −1 dollar-script/src/main/resources/examples/op/fork.ds
  46. +2 −3 dollar-script/src/main/resources/examples/op/is.ds
  47. +1 −1 dollar-script/src/main/resources/examples/op/is.md
  48. +4 −4 dollar-script/src/main/resources/examples/op/modulus.ds
  49. +5 −5 dollar-script/src/main/resources/examples/op/multiply.ds
  50. +1 −1 dollar-script/src/main/resources/examples/op/parallel.ds
  51. +4 −4 dollar-script/src/main/resources/examples/op/plus.ds
  52. +7 −7 dollar-script/src/main/resources/examples/op/range.ds
  53. +3 −0 dollar-script/src/main/resources/examples/op/type.ds
  54. +1 −0 dollar-script/src/main/resources/examples/op/type.md
  55. +2 −2 dollar-script/src/main/resources/examples/op/when-assign.ds
@@ -38,7 +38,7 @@
*
* @param cause the cause of this exception
*/
public DollarException(@NotNull Throwable cause) {
public DollarException(@NotNull Exception cause) {
super(unravel(cause));
}
@@ -57,14 +57,14 @@ public DollarException(@NotNull String message) {
* @param cause the cause of this exception
* @param message the error message associated with this exception
*/
public DollarException(@NotNull Throwable cause, @NotNull String message) {
public DollarException(@NotNull Exception cause, @NotNull String message) {
super(message, unravel(cause));
}
public static @NotNull
Throwable unravel(@NotNull Throwable e) {
Exception unravel(@NotNull Exception e) {
if ((e instanceof InvocationTargetException) || (e instanceof ExecutionException)) {
return unravel(e.getCause());
return unravel((Exception) e.getCause());
} else {
return e;
}
@@ -665,7 +665,7 @@ public static void setConfig(@NotNull Configuration config) {
* @return the Value
*/
@NotNull
public static Value handleError(@NotNull Throwable throwable, @Nullable Value failee) {
public static Value handleError(@NotNull Exception throwable, @Nullable Value failee) {
if (failee == null) {
return DollarFactory.failure(throwable);
}
@@ -724,7 +724,7 @@ public static void log(@NotNull String message) {
*/
@NotNull
@Deprecated
public static <R> R logAndRethrow(@NotNull Throwable throwable) {
public static <R> R logAndRethrow(@NotNull Exception throwable) {
if (throwable instanceof DollarException) {
throw (DollarException) throwable;
} else {
@@ -118,7 +118,7 @@
* @return an error Value if the method returns.
*/
@NotNull
Value handleError(@NotNull Throwable t);
Value handleError(@NotNull Exception t) throws RuntimeException;
/**
* Handle the error using any error handlers in this or parent scopes.
@@ -128,7 +128,7 @@
* @return an error Value if the method returns.
*/
@NotNull
Value handleError(@NotNull Throwable t, @NotNull Value context);
Value handleError(@NotNull Exception t, @NotNull Value context) throws RuntimeException;
/**
* Handle the error using any error handlers in this or parent scopes.
@@ -138,7 +138,7 @@
* @return an error Value if the method returns.
*/
@NotNull
Value handleError(@NotNull Throwable t, @NotNull Source context);
Value handleError(@NotNull Exception t, @NotNull Source context) throws RuntimeException;
/**
* Return's true if this scope contains a variable.
@@ -37,6 +37,10 @@
public static final VarKey STAR = of("*");
@NotNull
public static final VarKey THIS = of("this");
public static final VarKey TYPE = of("errorClass");
public static final VarKey MSG = of("msg");
@NotNull
public static final VarKey THREE = of(3);
@NotNull
@@ -29,19 +29,19 @@ public DollarFailureException(@NotNull ErrorType errorType, @NotNull String mess
super(errorType + ": " + message);
}
public DollarFailureException(@NotNull Throwable t, @NotNull ErrorType errorType) {
public DollarFailureException(@NotNull Exception t, @NotNull ErrorType errorType) {
super(t, errorType + ": " + t.getMessage());
}
public DollarFailureException(@NotNull Throwable cause) {
public DollarFailureException(@NotNull Exception cause) {
super(cause);
}
public DollarFailureException(@NotNull String message) {
super(message);
}
public DollarFailureException(@NotNull Throwable cause, @NotNull String message) {
public DollarFailureException(@NotNull Exception cause, @NotNull String message) {
super(cause, message);
}
}
@@ -20,7 +20,7 @@
import org.jetbrains.annotations.NotNull;
public class LambdaRecursionException extends DollarException {
public LambdaRecursionException(@NotNull Throwable e) {
public LambdaRecursionException(@NotNull Exception e) {
super(e);
}
@@ -20,7 +20,7 @@
import org.jetbrains.annotations.NotNull;
public class ValidationException extends DollarException {
public ValidationException(@NotNull Throwable e) {
public ValidationException(@NotNull Exception e) {
super(e);
}
@@ -23,7 +23,7 @@
public interface ScriptingLanguage extends ExtensionPoint {
@NotNull Value compile(@NotNull String java, @NotNull Scope scope);
@NotNull Value compile(@NotNull String java, @NotNull Scope scope) throws Exception;
boolean provides(@NotNull String language);
}
@@ -36,7 +36,7 @@
@NotNull
public static Value compile(@NotNull String language,
@NotNull String script,
@NotNull Scope scope) {
@NotNull Scope scope) throws Exception {
ScriptingLanguage scriptingLanguage = resolveScriptProvider(language);
return scriptingLanguage.compile(script, scope);
}
@@ -338,7 +338,7 @@ public static Value deserialize64(@NotNull String s) {
* @return the Value
*/
@NotNull
public static Value failure(@NotNull ErrorType errorType, @NotNull Throwable t, boolean quiet) {
public static Value failure(@NotNull ErrorType errorType, @NotNull Exception t, boolean quiet) {
if (DollarStatic.getConfig().failFast() && !quiet) {
throw new DollarFailureException(t, errorType);
} else {
@@ -354,7 +354,7 @@ public static Value failure(@NotNull ErrorType errorType, @NotNull Throwable t,
* @return the Value
*/
@NotNull
public static Value failure(@NotNull ErrorType errorType, @NotNull Throwable t) {
public static Value failure(@NotNull ErrorType errorType, @NotNull Exception t) {
if (DollarStatic.getConfig().failFast()) {
throw new DollarFailureException(t, errorType);
} else {
@@ -402,7 +402,7 @@ public static Value failure(@NotNull ErrorType errorType, @NotNull String messag
* @return the Value
*/
@NotNull
public static Value failure(@NotNull Throwable throwable) {
public static Value failure(@NotNull Exception throwable) {
return failure(ErrorType.EXCEPTION, throwable, false);
}
@@ -415,7 +415,7 @@ public static Value failure(@NotNull Throwable throwable) {
* @return the Value
*/
@NotNull
public static Value failureWithSource(@NotNull ErrorType errorType, @NotNull Throwable throwable,
public static Value failureWithSource(@NotNull ErrorType errorType, @NotNull Exception throwable,
@Nullable Source source) {
if (source == null) {
throw new NullPointerException();
Oops, something went wrong.

0 comments on commit f0d22af

Please sign in to comment.