Skip to content

Commit

Permalink
Code style: Lint
Browse files Browse the repository at this point in the history
Fix lint violations detected by #200
  • Loading branch information
julianhyde committed Aug 20, 2023
1 parent e1b9ee7 commit b36504b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/hydromatic/morel/compile/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ public enum Use {
* val g = fn ys => map (fn x => E) ys
* }</pre>
*
* no code is duplicated, but a small bounded amount of work is duplicated,
* because the closure {@code fn x => E} must be allocated each time
* {@code g} is called. */
* <p>no code is duplicated, but a small bounded amount of work is
* duplicated, because the closure {@code fn x => E} must be allocated
* each time {@code g} is called. */
ONCE_UNSAFE,

/** The binding may occur many times, including inside lambdas. */
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/hydromatic/morel/eval/Prop.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public enum Prop {
* <a href="https://www.smlnj.org/doc/Compiler/pages/printcontrol.html">PRINTCONTROL signature</a>
* of the Standard Basis Library.
*
* Default is 12. */
* <p>Default is 12. */
PRINT_LENGTH("printLength", Integer.class, 12),

/** Boolean property "relationalize" is
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/hydromatic/morel/util/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static <K, V> List<Pair<K, V>> zip(List<K> ks, List<V> vs) {
* Converts two lists into a list of {@link Pair}s.
*
* <p>The length of the combined list is the lesser of the lengths of the
* source lists. But typically the source lists will be the same length.</p>
* source lists. But typically the source lists will be the same length.
*
* @param ks Left list
* @param vs Right list
Expand Down Expand Up @@ -254,7 +254,7 @@ public static <K, V> void forEachIndexed(Map<K, V> map,
* Converts two iterables into an iterable of {@link Pair}s.
*
* <p>The resulting iterator ends whenever the first of the input iterators
* ends. But typically the source iterators will be the same length.</p>
* ends. But typically the source iterators will be the same length.
*
* @param ks Left iterable
* @param vs Right iterable
Expand All @@ -276,7 +276,7 @@ public static <K, V> Iterable<Pair<K, V>> zip(
*
* <p>The length of the combined list is the lesser of the lengths of the
* source arrays. But typically the source arrays will be the same
* length.</p>
* length.
*
* @param ks Left array
* @param vs Right array
Expand Down Expand Up @@ -382,7 +382,7 @@ public int size() {
/**
* Returns an iterator that iterates over (i, i + 1) pairs in an iterable.
*
* <p>For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)].</p>
* <p>For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)].
*
* @param iterable Source collection
* @param <T> Element type
Expand All @@ -402,7 +402,7 @@ public static <T> Iterable<Pair<T, T>> adjacents(final Iterable<T> iterable) {
* Returns an iterator that iterates over (0, i) pairs in an iterable for
* i &gt; 0.
*
* <p>For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)].</p>
* <p>For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)].
*
* @param iterable Source collection
* @param <T> Element type
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/net/hydromatic/morel/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1250,11 +1250,10 @@ public class MainTest {
ml(ml).assertEval(is(7));
}

/**
* <p>The algorithm is described in <a href="https://stackoverflow.com/questions/7883023/algorithm-for-type-checking-ml-like-pattern-matching">
* Stack overflow</a> and in Lennart Augustsson's 1985 paper "Compiling
* Pattern Matching".
*/
/** The algorithm is described in
* <a href="https://stackoverflow.com/questions/7883023/algorithm-for-type-checking-ml-like-pattern-matching">
* Stack overflow</a> and in Lennart Augustsson's 1985 paper "Compiling
* Pattern Matching". */
@Test void testMatchRedundant() {
final String ml = "fun f x = case x > 0 of\n"
+ " true => \"positive\"\n"
Expand Down

0 comments on commit b36504b

Please sign in to comment.