diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/BinaryDependencyTests.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/BinaryDependencyTests.rsc index 4aaecb4c68e..f8ec3b8d6f2 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/BinaryDependencyTests.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/BinaryDependencyTests.rsc @@ -398,7 +398,7 @@ test bool incompatibleVersionsOfBinaryLibrary(){ // Important: we do not recompile TP (and thus it will contain the outdated version of IO) - // Update Checks' modifcation time to make sure it will rechecked + // Update Checks' modification time to make sure it will rechecked touch(getRascalModuleLocation("Check", core.pcfg)); // Recompile Check and discover the error return checkExpectErrors("Check", ["Review of dependencies, reconfiguration or recompilation needed: binary module `TP` depends (indirectly) on incompatible module(s)"], core.pcfg, remove = [rascal, typepal, core]); diff --git a/src/org/rascalmpl/library/IO.rsc b/src/org/rascalmpl/library/IO.rsc index 24cb667fea6..5e3255b4f67 100644 --- a/src/org/rascalmpl/library/IO.rsc +++ b/src/org/rascalmpl/library/IO.rsc @@ -682,7 +682,7 @@ public java void remove(loc file, bool recursive=true) throws IO; @javaClass{org.rascalmpl.library.Prelude} @synopsis{Rename files or directories} @benefits{ -* will rename between schemes and within schemes, seemlessly. +* will rename between schemes and within schemes, seamlessly. * within schemes renaming is implemented as close to the operating system rename functionality as possible. This can be very fast. } @pitfalls{ diff --git a/src/org/rascalmpl/library/List.rsc b/src/org/rascalmpl/library/List.rsc index 9b4f044d754..aa7be84cc1c 100644 --- a/src/org/rascalmpl/library/List.rsc +++ b/src/org/rascalmpl/library/List.rsc @@ -362,12 +362,12 @@ Optional, a comparison function `lessOrEqual` may be given for a user-defined or ```rascal-shell import List; merge([1, 3, 5], [2, 7, 9, 15]); -merge(["ape", "elephant", "owl", "snale", "zebra"], ["apple", "berry", "orange", "pineapple"]); +merge(["ape", "elephant", "owl", "snail", "zebra"], ["apple", "berry", "orange", "pineapple"]); ``` Merge two lists of strings and use their length as ordering: ```rascal-shell,continue import String; -merge(["ape", "owl", "snale", "zebra", "elephant"], ["apple", "berry", "orange", "pineapple"], bool(str x, str y){ return size(x) <= size(y); }); +merge(["ape", "owl", "snail", "zebra", "elephant"], ["apple", "berry", "orange", "pineapple"], bool(str x, str y){ return size(x) <= size(y); }); ``` } list[&T] merge(list[&T] left, list[&T] right){ diff --git a/src/org/rascalmpl/library/ListRelation.rsc b/src/org/rascalmpl/library/ListRelation.rsc index bd6ff58a5e2..d88b9b8c273 100644 --- a/src/org/rascalmpl/library/ListRelation.rsc +++ b/src/org/rascalmpl/library/ListRelation.rsc @@ -134,7 +134,7 @@ public lrel[&T0, &T1, &T2, &T3, &T4] complement(lrel[&T0, &T1, &T2, &T3, &T4] R) @description{ The domain can be seen as all possible inputs of the relation image operation. The result contains elements (or tuples) in the order of appearance of the original relation, -but all occurences after the first occurrence of an element have been removed. +but all occurrences after the first occurrence of an element have been removed. } @examples{ ```rascal-shell @@ -171,7 +171,7 @@ public lrel[&T0,&T1,&T2,&T3] domainR (lrel[&T0,&T1,&T2,&T3] R, set[&T0] S) public lrel[&T0,&T1,&T2,&T3,&T4] domainR (lrel[&T0,&T1,&T2,&T3,&T4] R, set[&T0] S) = [ | <&T0 V0, &T1 V1, &T2 V2, &T3 V3, &T4 V4> <- R, V0 in S ]; -// If the restiction is specified as a list, we take the order of tuples from there +// If the restriction is specified as a list, we take the order of tuples from there public lrel[&T0,&T1] domainR (lrel[&T0,&T1] R, list[&T0] L) = [ | &T0 V0 <- L, <- R]; @@ -214,7 +214,7 @@ public lrel[&T0, &T1, &T2, &T3, &T4] domainX (lrel[&T0, &T1, &T2, &T3, &T4] R, s @examples{ ```rascal-shell import ListRelation; -legs = [<"bird", 2>, <"dog", 4>, <"human", 2>, <"spider", 8>, <"millepede", 1000>, <"crab", 8>, <"cat", 4>]; +legs = [<"bird", 2>, <"dog", 4>, <"human", 2>, <"spider", 8>, <"millipede", 1000>, <"crab", 8>, <"cat", 4>]; groupDomainByRange(legs); ``` } @@ -266,7 +266,7 @@ public lrel[&T4,&T3,&T2,&T1,&T0] invert (lrel[&T0,&T1,&T2,&T3,&T4] R) = R<4,3,2, @description{ The range can be seen as all the elements of in all possible images of the relation. The result contains elements (or tuples) in the order of appearance of the original relation, -but all occurences after the first occurrence of an element have been removed. +but all occurrences after the first occurrence of an element have been removed. } @examples{ ```rascal-shell @@ -294,7 +294,7 @@ rangeR([<1,10>, <2,20>, <3,30>], {30, 10}); public lrel[&T0,&T1] rangeR (lrel[&T0,&T1] R, set[&T1] S) = [ | <&T0 V0, &T1 V1> <- R, V1 in S ]; -// If the restiction is specified as a list, we take the order of tuples from there +// If the restriction is specified as a list, we take the order of tuples from there public lrel[&T0,&T1] rangeR (lrel[&T0,&T1] R, list[&T1] L) = [ | &T1 V1 <- L, <&T0 V0, V1> <- R ]; @@ -316,7 +316,7 @@ public lrel[&T0,&T1] rangeX (lrel[&T0,&T1] R, list[&T1] S) = [ | <&T0 V0, &T1 V1> <- R, V1 notin S ]; -@synopsis{Listes a binary list relation as a map} +@synopsis{Lists a binary list relation as a map} @description{ Converts a binary list relation to a map of the domain to a set of the range. } diff --git a/src/org/rascalmpl/library/Location.rsc b/src/org/rascalmpl/library/Location.rsc index c812df006e3..090156425e2 100644 --- a/src/org/rascalmpl/library/Location.rsc +++ b/src/org/rascalmpl/library/Location.rsc @@ -44,7 +44,7 @@ loc relativize(list[loc] haystack, loc needle) throws PathNotFound { throw PathNotFound(needle); } -@synsopis{Concatenate a relative path to a given surrounding path} +@synopsis{Concatenate a relative path to a given surrounding path} @description{ * `relative` must be of scheme `relative:///` or `SchemeNotSupported` will be thrown * ((resolve)) is the opposite of ((relativize)) @@ -94,7 +94,7 @@ java bool isSameFile(loc l, loc r); When the two locations refer to different files, their paths are compared as string. When they refer to the same file, their offsets are compared when present. } -@pittfalls{ +@pitfalls{ This ordering regards the location value itself as opposed to the text it refers to. } bool isLexicallyLess(loc l, loc r) diff --git a/src/org/rascalmpl/library/ParseTree.rsc b/src/org/rascalmpl/library/ParseTree.rsc index f0825f3551f..e1e49aa00de 100644 --- a/src/org/rascalmpl/library/ParseTree.rsc +++ b/src/org/rascalmpl/library/ParseTree.rsc @@ -151,7 +151,7 @@ import Set; @synopsis{The Tree data type as produced by the parser.} @description{ -A `Tree` defines the trees normally found after parsing; additional constructors exist for execptional cases: +A `Tree` defines the trees normally found after parsing; additional constructors exist for exceptional cases: <1> Parse tree constructor when parse succeeded. <2> Cyclic parsetree. @@ -396,7 +396,7 @@ conversion methods to make sure selection and highlighting ranges (for example) character metaphor breaks. It depends on how the editor internally handles graphemes and on the way it is connected to Rascal what the effect for the user is. * @\loc annotations make ((Tree)) instances _unique_ ,where otherwise they could be semantically and syntactically equivalent. -Therefor if you want to test for ((Tree)) (in)equality, always use `t1 := t2` and `t1 !:= t2`. Pattern matching already automatically +Therefore if you want to test for ((Tree)) (in)equality, always use `t1 := t2` and `t1 !:= t2`. Pattern matching already automatically ignores @\loc annotations and whitespace and comments. * Annotated trees are strictly too big for optimal memory usage. Often `@\loc` is the first and only annotation, so it introduces a map for keyword parameters for every node. Also more nodes are different, impeding in optimal reference sharing. If you require long time storage of many @@ -524,7 +524,7 @@ java &T (value input, loc origin) parser(type[&T] grammar, bool allowAmbiguity=f @javaClass{org.rascalmpl.library.Prelude} @synopsis{Generates a parser function that can be used to find the left-most deepest ambiguous sub-sentence.} @benefits{ -* Instead of trying to build a polynomially sized parse forest, this function only builds the smallest part of +* Instead of trying to build a polynomial-sized parse forest, this function only builds the smallest part of the tree that exhibits ambiguity. This can be done very quickly, while the whole forest could take minutes to hours to construct. * Use this function for ambiguity diagnostics and regression testing for ambiguity. } @@ -545,7 +545,7 @@ java &U (type[&U] nonterminal, value input, loc origin) parsers(type[&T] grammar @javaClass{org.rascalmpl.library.Prelude} @synopsis{Generates a parser function that can be used to find the left-most deepest ambiguous sub-sentence.} @benefits{ -* Instead of trying to build a polynomially sized parse forest, this function only builds the smallest part of +* Instead of trying to build a polynomial-sized parse forest, this function only builds the smallest part of the tree that exhibits ambiguity. This can be done very quickly, while the whole forest could take minutes to hours to construct. * Use this function for ambiguity diagnostics and regression testing for ambiguity. } @@ -585,7 +585,7 @@ for the same grammar, if (and only if) it was stored for the same grammar value. } @benefits{ * storing parsers is to cache the work of reifing a grammar, and generating a parser from that grammar. -* stored parsers are nice for deployment scenerios where the language is fixed and efficiency is appreciated. +* stored parsers are nice for deployment scenarios where the language is fixed and efficiency is appreciated. } @pitfalls{ * caching parsers with `storeParsers` is your responsibility; the cache is not cleaned automatically when the grammar changes. @@ -625,7 +625,7 @@ p(type(sort("E"), ()), "e+e", |src:///|); ``` } @benefits{ -* loaded parsers can be used immediately without the need of loadig and executing a parser generator. +* loaded parsers can be used immediately without the need of loading and executing a parser generator. } @pitfalls{ * reifiying types (use of `#`) will trigger the loading of a parser generator anyway. You have to use @@ -874,7 +874,7 @@ yield of a tree should always produce the exact same locations as ((reposition)) @benefits{ * Unlike reparsing, ((reposition)) will maintain all other keyword parameters of ((Tree)) nodes, like resolved qualified names and type attributes. * Can be used to erase superfluous annotations for memory efficiency, while keeping the essential ones. -* The default mark options simulatete the behavior of ((parser)) functions. +* The default mark options simulate the behavior of ((parser)) functions. } &T <: Tree reposition( &T <: Tree tree, diff --git a/src/org/rascalmpl/library/Relation.rsc b/src/org/rascalmpl/library/Relation.rsc index 0d249f2b2fa..09a2a0b16fb 100644 --- a/src/org/rascalmpl/library/Relation.rsc +++ b/src/org/rascalmpl/library/Relation.rsc @@ -258,7 +258,7 @@ public rel[&T0,&T1,&T2,&T3,&T4] domainX (rel[&T0,&T1,&T2,&T3,&T4] R, set[&T0] S) @examples{ ```rascal-shell import Relation; -legs = {<"bird", 2>, <"dog", 4>, <"human", 2>, <"spider", 8>, <"millepede", 1000>, <"crab", 8>, <"cat", 4>}; +legs = {<"bird", 2>, <"dog", 4>, <"human", 2>, <"spider", 8>, <"millipede", 1000>, <"crab", 8>, <"cat", 4>}; groupDomainByRange(legs); ``` } diff --git a/src/org/rascalmpl/library/Set.rsc b/src/org/rascalmpl/library/Set.rsc index 729b96ea4c0..2e40e3f1a36 100644 --- a/src/org/rascalmpl/library/Set.rsc +++ b/src/org/rascalmpl/library/Set.rsc @@ -32,7 +32,7 @@ import Set; ``` Create a map from animals to number of legs. ```rascal-shell,continue -legs = ("bird": 2, "dog": 4, "human": 2, "snake": 0, "spider": 8, "millepede": 1000, "crab": 8, "cat": 4); +legs = ("bird": 2, "dog": 4, "human": 2, "snake": 0, "spider": 8, "millipede": 1000, "crab": 8, "cat": 4); ``` Define function `nLegs` that returns the number of legs for each animal (or `0` when the animal is unknown): ```rascal-shell,continue @@ -42,7 +42,7 @@ int nLegs(str animal){ ``` Now classify a set of animals: ```rascal-shell,continue -classify({"bird", "dog", "human", "spider", "millepede", "zebra", "crab", "cat"}, nLegs); +classify({"bird", "dog", "human", "spider", "millipede", "zebra", "crab", "cat"}, nLegs); ``` } public map[&K,set[&V]] classify(set[&V] input, &K (&V) getClass) = toMap({ | e <- input}); @@ -58,7 +58,7 @@ import Set; ``` Create a map from animals to number of legs. ```rascal-shell,continue -legs = ("bird": 2, "dog": 4, "human": 2, "snake": 0, "spider": 8, "millepede": 1000, "crab": 8, "cat": 4); +legs = ("bird": 2, "dog": 4, "human": 2, "snake": 0, "spider": 8, "millipede": 1000, "crab": 8, "cat": 4); ``` Define function `nLegs` that returns the number of legs fro each animal (or `0` when the animal is unknown): ```rascal-shell,continue @@ -69,7 +69,7 @@ bool similar(str a, str b) = nLegs(a) == nLegs(b); ``` Now group a set of animals: ```rascal-shell,continue -group({"bird", "dog", "human", "spider", "millepede", "zebra", "crab", "cat"}, similar); +group({"bird", "dog", "human", "spider", "millipede", "zebra", "crab", "cat"}, similar); ``` WARNING: check compiler. } @@ -251,7 +251,7 @@ public java int size(set[&T] st); public (&T <:num) sum(set[(&T <:num)] _:{}) { throw ArithmeticException( - "For the emtpy set it is not possible to decide the correct precision to return.\n + "For the empty set it is not possible to decide the correct precision to return.\n 'If you want to call sum on empty set, use sum({0.000}+st) or sum({0r} +st) or sum({0}+st) 'to make the set non-empty and indicate the required precision for the sum of the empty set "); @@ -493,7 +493,7 @@ This function is fast if `k` is relatively small, say 10 out of a 1000 elements. It operates in O(n*k) time where n is the size of the set. If `k` is a larger value, say `k > 10`, then it's perhaps better to just sort the entire set -using the asympotically faster (n*log^2(n)) sort function and take the first `k` elements of the resulting list. +using the asymptotically faster (n*log^2(n)) sort function and take the first `k` elements of the resulting list. If `k` is a negative number, `top` will return the largest `abs(k)` elements of the set instead of the smallest. } diff --git a/src/org/rascalmpl/library/String.rsc b/src/org/rascalmpl/library/String.rsc index d2d5ad285a5..83940314813 100644 --- a/src/org/rascalmpl/library/String.rsc +++ b/src/org/rascalmpl/library/String.rsc @@ -584,7 +584,7 @@ public java str toBase64(str src, str charset=DEFAULT_CHARSET, bool includePaddi @synopsis{Decode a base-64 encoded string.} @description { - Convert a base-64 encoded string to bytes and then convert these bytes to a string using the specified cahracter set. + Convert a base-64 encoded string to bytes and then convert these bytes to a string using the specified character set. The base-64 encoding used is defined by RFC 4648: https://www.ietf.org/rfc/rfc4648.txt. } @javaClass{org.rascalmpl.library.Prelude} @@ -600,7 +600,7 @@ public java str toBase32(str src, str charset=DEFAULT_CHARSET, bool includePaddi @synopsis{Decode a base-32 encoded string.} @description { - Convert a base-32 encoded string to bytes and then convert these bytes to a string using the specified cahracter set. + Convert a base-32 encoded string to bytes and then convert these bytes to a string using the specified character set. The base-32 encoding used is defined by RFC 4648: https://www.ietf.org/rfc/rfc4648.txt. } @javaClass{org.rascalmpl.library.Prelude} @@ -643,7 +643,7 @@ toLocation("http://grammarware.net"); toLocation("document.xml"); ``` } -@deprecated{Use ((lang::paths::Windows::parseWindowsPath)) for example; toLocation does not handle all intricasies of path notation.} +@deprecated{Use ((lang::paths::Windows::parseWindowsPath)) for example; toLocation does not handle all intricacies of path notation.} public loc toLocation(str s) = (/\:\/\// := s) ? |://| : |cwd:///|; diff --git a/src/org/rascalmpl/library/Type.rsc b/src/org/rascalmpl/library/Type.rsc index 94b78bcbe1d..8c6cafe1997 100644 --- a/src/org/rascalmpl/library/Type.rsc +++ b/src/org/rascalmpl/library/Type.rsc @@ -28,7 +28,7 @@ In other words, the `#` operator will always produce a value of `type[&T]`, wher The ((subtype)) relation of Rascal has all the mathematical properties of a _finite lattice_; where ((lub)) implements the _join_ and ((glb)) implements the _meet_ operation. This is a core design principle of Rascal with the following benefits: -* Type inference has a guaranteed least or greatest solution, always. This means that constraints are always solvable in an unambigous manner. +* Type inference has a guaranteed least or greatest solution, always. This means that constraints are always solvable in an unambiguous manner. * A _principal type_ can always be computed, which is a most precise and unique solution of a type inference problem. Without the lattice, solution candidates could become incomparable and thus ambiguous. Without this principal type property, type inference is predictable for programmers. * Solving type inference constraints can be implemented efficiently. The algorithm, based on ((lub)) and ((glb)), makes progress _deterministically_ and does not require backtracking @@ -113,7 +113,7 @@ Symbol \lrel(list[Symbol] symbols) = \list(\tuple(symbols)); -@synopsis{Overloaded/union types are always reduced to the least upperbound of their constituents.} +@synopsis{Overloaded/union types are always reduced to the least upper bound of their constituents.} @description{ This semantics of overloading in the type system is essential to make sure it remains a _lattice_. } @@ -249,7 +249,7 @@ bool equivalent(type[value] s, type[value] t) = equivalent(s.symbol, t.symbol); The difference between `eq` and `==` is that no implicit coercions are done between values of incomparable types at the top-level. -The `==` operator, for convience, equates `1.0` with `1` but not `[1] with [1.0]`, which can be annoying +The `==` operator, for convenience, equates `1.0` with `1` but not `[1] with [1.0]`, which can be annoying when writing consistent specifications. The new number system that is coming up will not have these issues. } @examples{ @@ -262,7 +262,7 @@ eq(1,1.0) @javaClass{org.rascalmpl.library.Type} java bool eq(value x, value y); -@synopsis{The least-upperbound (lub) of two types is the common ancestor in the type lattice that is lowest.} +@synopsis{The least upper bound (lub) of two types is the common ancestor in the type lattice that is lowest.} @description{ This function implements the lub operation in Rascal's type system, via unreifying the Symbol values and calling into the underlying run-time Type implementation. diff --git a/src/org/rascalmpl/library/analysis/diff/edits/HiFiLayoutDiff.rsc b/src/org/rascalmpl/library/analysis/diff/edits/HiFiLayoutDiff.rsc index 1154f2a9177..65a5b722ca4 100644 --- a/src/org/rascalmpl/library/analysis/diff/edits/HiFiLayoutDiff.rsc +++ b/src/org/rascalmpl/library/analysis/diff/edits/HiFiLayoutDiff.rsc @@ -4,7 +4,7 @@ This algorithm is the final component of a declarative high fidelity source code We have the following assumptions: 1. One original text file exists. -2. One ((ParseTree)) of the original file to be formatted, containing all orginal layout and source code comments and case-insensitive literals in the exact order of the original text file. In other words, +2. One ((ParseTree)) of the original file to be formatted, containing all original layout and source code comments and case-insensitive literals in the exact order of the original text file. In other words, nothing may have happened to the parse tree after parsing. 3. One ((ParseTree)) of the _same_ file, but formatted (using a formatting algorithm like ((Tree2Box)) `|` ((Box2Text)), or string templates, and then re-parsing). This is typically obtained by translating the tree to a `str` using some formatting tools, and then reparsing the file. diff --git a/src/org/rascalmpl/library/analysis/diff/edits/HiFiTreeDiff.rsc b/src/org/rascalmpl/library/analysis/diff/edits/HiFiTreeDiff.rsc index 2fcb2d3b3d5..f6ecd9dd669 100644 --- a/src/org/rascalmpl/library/analysis/diff/edits/HiFiTreeDiff.rsc +++ b/src/org/rascalmpl/library/analysis/diff/edits/HiFiTreeDiff.rsc @@ -6,7 +6,7 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, -this litst of conditions and the following disclaimer. +this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation @@ -45,7 +45,7 @@ On the other hand, ParseTree to ParseTree rewrites are much easier to write and They are "syntax directed" via the shape of the tree that follows the grammar of the language. Some if not all of the above aspects are tackled by the rewriting mechanism with concrete patterns. Especially the corner cases w.r.t. list separators are all handled by the rewriting mechanisms. -Also the rules are in "concrete syntax", on both the matching and the substition side. So they are +Also the rules are in "concrete syntax", on both the matching and the substitution side. So they are readable for all who know the object language. The rules guarantee syntactic correctness of the rewritten source code. However, rewrite rules do quite some noisy damage to the layout, indentation and comments, of the result. @@ -63,9 +63,9 @@ case-insensitive keywords retain their original shape. * Changes to the grammar will be picked up when checking all source and target patterns. * The diff algorithm uses cross-cutting information from the parse tree (what is layout and what not, what is case-insensitive, etc.) which would otherwise have to be managed by the language engineer in _every rewrite rule_. -* The diff algoritm understands what indentation is and brings new sub-trees to the original level +* The diff algorithm understands what indentation is and brings new sub-trees to the original level of indentation (same as the sub-trees they are replacing) -* Typically the algorithm's run-time is lineair in the size of the tree, or better. Same for memory usage. +* Typically the algorithm's run-time is linear in the size of the tree, or better. Same for memory usage. } @pitfalls{ * ((treeDiff)) only works under the assumption that the second tree was derived from the first @@ -78,7 +78,7 @@ testing. If the trees are first independently serialized to disk and then deseri this optimization is not present and the algorithm will perform (very) poorly. * Substitution patterns should be formatted as best as possible. The algorithm will not infer spacing or relative indentation inside of the substituted subtree. It will only infer indentation -for the entire subtree. Another way of resolving this is using a code formatter on the subsituted patterns. +for the entire subtree. Another way of resolving this is using a code formatter on the substituted patterns. } module analysis::diff::edits::HiFiTreeDiff @@ -93,7 +93,7 @@ import util::Math; @synopsis{Detects minimal differences between parse trees and makes them explicit as ((TextEdit)) instructions.} @description{ This is a "diff" algorithm of two parse trees to generate a ((TextEdit)) script that applies the differences on -the textual level, _with minimal collatoral damage in whitespace_. This is why it is called "HiFi": minimal unnecessary +the textual level, _with minimal collateral damage in whitespace_. This is why it is called "HiFi": minimal unnecessary noise introduction to the original file. It also tries to conserve source code comments; where still possible. The resulting ((TextEdit))s are an intermediate representation for making changes in source code text files. @@ -107,7 +107,7 @@ From the tree node differences between these two trees, ((TextEdit))s are derive * when the edited source text is parsed again, the resulting tree would match the derived tree. However, the parsed tree could be different from the derived tree in terms of whitespace, indentation and case-insensitive literals (see below). * when tree nodes (grammar rules) are equal, smaller edits are searched by pair-wise comparison of the children -* differences between respective layout or (case insensitve) literal nodes are always ignored +* differences between respective layout or (case insensitive) literal nodes are always ignored * when lists have changed, careful editing of possible separators ensures syntactic correctness * when new sub-trees are inserted, the replacement will be at the same indentation level as the original. * when case-insensitive literals have been changed under a grammar rule that remained the same, no edits are produced. @@ -124,7 +124,7 @@ the exactness of syntactic and semantic knowledge of the parse trees. * Where possible the algorithm also retains the capitalization of case-insensitive literals. * The algorithm retrieves and retains indentation levels from the original tree, even if sub-trees in the derived tree have mangled indentation. This allows us to ignore the indentation concern while thinking of rewrite -rules for source-to-souce transformation, and focus on the semantic effect. +rules for source-to-source transformation, and focus on the semantic effect. * The algorithm inherits source code comments from the original, wherever sub-trees of the original and the rewritten tree still line up. } @@ -172,7 +172,7 @@ rewritten = visit(original) { ' <{Statement ";"}* ifBranch> 'fi` } -// Check the result as a string. It worked, but we see some collatoral damage in whitespace (indentation). +// Check the result as a string. It worked, but we see some collateral damage in whitespace (indentation). "" // Now derive text edits from the two parse trees: edits = treeDiff(original, rewritten); @@ -398,9 +398,9 @@ private loc cover(list[Tree] elems:[_, *_]) = cover([e@\loc | Tree e <- elems, e @synopsis{yield a consecutive list of trees} private str yield(list[Tree] elems) = "<}>"; -@synopsis{Make sure the subtitution is at least as far indented as the original} +@synopsis{Make sure the substitution is at least as far indented as the original} @description{ -This algorithm ignores the first line, since the first line is always preceeded by the layout of a parent node. +This algorithm ignores the first line, since the first line is always preceded by the layout of a parent node. Then it measures the depth of indentation of every line in the original, and takes the minimum. That minimum indentation is stripped off every line that already has that much indentation in the replacement, diff --git a/src/org/rascalmpl/library/analysis/m3/AST.rsc b/src/org/rascalmpl/library/analysis/m3/AST.rsc index 2003d19c893..0cffadc4594 100644 --- a/src/org/rascalmpl/library/analysis/m3/AST.rsc +++ b/src/org/rascalmpl/library/analysis/m3/AST.rsc @@ -104,7 +104,7 @@ data Type( @synopsis{Uniform name for everything that is a _modifier_ in programming languages syntax: public, static, final, etc.} @description{ -Instances of the Modifer type represent the _syntax_ of modifiers in programming languages. +Instances of the Modifier type represent the _syntax_ of modifiers in programming languages. | field name | description | | ---------- | ----------- | diff --git a/src/org/rascalmpl/library/analysis/m3/Core.rsc b/src/org/rascalmpl/library/analysis/m3/Core.rsc index e39549ecac4..f2d09ef9e2e 100644 --- a/src/org/rascalmpl/library/analysis/m3/Core.rsc +++ b/src/org/rascalmpl/library/analysis/m3/Core.rsc @@ -103,10 +103,10 @@ semantics. Sometimes to connect the merged models also new connections must be m When we simulate static composition, these analyses are ground truth, but when we simulate dynamic loading we have to treat the results as heuristic inferences. * Not every programming language front-end that creates M3 models has to have implemented all the above relations (yet). Constructing such a front-end may take time and incrementally growing models can already be very useful. -* Even though M3 models can have errors and be partially populated, please be aware that partially correct programs lead to partically correct models and all downstream analysis is correspondingly inaccurate. +* Even though M3 models can have errors and be partially populated, please be aware that partially correct programs lead to partially correct models and all downstream analysis is correspondingly inaccurate. * In statically types programming languages the `declarations` relation is typically one-to-one and the `uses` relation is `many-to-one`, which means that name resolution is _unique_ at _compile-time_. However this is not required for other more dynamic languages, and this is fine. -You will see that one qualified name could potentionally resolve to different artefacts at run-time. This will be reflected by the `uses` relation +You will see that one qualified name could potentially resolve to different artefacts at run-time. This will be reflected by the `uses` relation also having _many-to-many_ tuples in it. **Be careful how you count**, for example, _dependencies_ or _coupling_ in such cases since we are literally already over-approximating the reality of the running program. } @@ -288,7 +288,7 @@ _internal_ consistency of an M3 model. If an M3 instance is a `closedWorld` model, this means that there are no `uses` in the model that are not declared in the current model in `declarations`. A closed world model allows for more -stringent consistenct checks than a model that depends on external declarations. By selecting +stringent consistency checks than a model that depends on external declarations. By selecting `closedWorld=true` those additional checks are enabled, otherwise these are ignored or weakened accordingly. It is advisable to provide at least one closed model per programming language front-end, while testing against this spec. @@ -298,7 +298,7 @@ This is a simple check for knowing if the test covers the language in some form. } @benefits{ * Front-end construction is tricky business. This test provides a sanity check before users start depending -on fawlty models. +on faulty models. } @pitfalls{ * In `closedWorld` many things can be strictly checked, but in an open world with dependencies outside diff --git a/src/org/rascalmpl/library/analysis/m3/TypeSymbol.rsc b/src/org/rascalmpl/library/analysis/m3/TypeSymbol.rsc index 3c8bdc5ee90..a3f3796f3a4 100644 --- a/src/org/rascalmpl/library/analysis/m3/TypeSymbol.rsc +++ b/src/org/rascalmpl/library/analysis/m3/TypeSymbol.rsc @@ -11,7 +11,7 @@ As a basic principle, the symbols for declared types always link to their defini We cater for languages to have a subtype relation to be defined, and a least upper bound computation. } @benefits{ -* symbolic types can be analyzed and manipulated symbolically, i.e. to instatiate parametrized types. +* symbolic types can be analyzed and manipulated symbolically, i.e. to instantiate parametrized types. * symbolic types can be used directly as constraint variables for type inference or type-based refactoring purposes. } @pitfalls{ diff --git a/src/org/rascalmpl/library/analysis/statistics/Frequency.rsc b/src/org/rascalmpl/library/analysis/statistics/Frequency.rsc index 5bd8a988b74..092f26148ba 100644 --- a/src/org/rascalmpl/library/analysis/statistics/Frequency.rsc +++ b/src/org/rascalmpl/library/analysis/statistics/Frequency.rsc @@ -14,7 +14,7 @@ categories and then quickly counting the frequency of each occurring event. This module helps by providing commonly used functions for the purpose of counting events. The output of these functions can be used to draw (cumulative) histograms, or they can -directly be used for further statistical processing and visualisation. +directly be used for further statistical processing and visualization. } module analysis::statistics::Frequency diff --git a/src/org/rascalmpl/library/analysis/statistics/SimpleRegression.rsc b/src/org/rascalmpl/library/analysis/statistics/SimpleRegression.rsc index f185a146ee7..a1815b1abd1 100644 --- a/src/org/rascalmpl/library/analysis/statistics/SimpleRegression.rsc +++ b/src/org/rascalmpl/library/analysis/statistics/SimpleRegression.rsc @@ -18,7 +18,7 @@ import Exception; @synopsis{Intercept of regression line.} @description{ -Returns the [interce](http://en.wikipedia.org/wiki/Root_of_a_function) of the estimated regression line. +Returns the [intercept](http://en.wikipedia.org/wiki/Root_of_a_function) of the estimated regression line. The least squares estimate of the intercept is computed using these [normal equations](http://www.xycoon.com/estimation4.htm) } @@ -117,7 +117,7 @@ public java num slopeStdErr(lrel[num,num] values) throws IllegalArgument; @synopsis{Sum of cross products of observations.} @description{ -Returns the sum of crossproducts, x__~i~*y__~i~. +Returns the sum of cross products, x__~i~*y__~i~. } @javaClass{org.rascalmpl.library.analysis.statistics.SimpleRegressions} public java num sumOfCrossProducts(lrel[num,num] values) throws IllegalArgument; diff --git a/src/org/rascalmpl/library/lang/box/syntax/Box.rsc b/src/org/rascalmpl/library/lang/box/syntax/Box.rsc index 9e43f84eda1..bf6ef897bb9 100644 --- a/src/org/rascalmpl/library/lang/box/syntax/Box.rsc +++ b/src/org/rascalmpl/library/lang/box/syntax/Box.rsc @@ -24,7 +24,7 @@ module lang::box::\syntax::Box * `U` splices its contents in the surrounding box, for automatic flattening of overly nested structures in syntax trees. * `G` is an additional group-by feature that reduces tot the above core features * `SL` is a convenience box for separated syntax lists based on `G` -* `NULL()` is the group that will dissappear from its context, useful for skipping content. It is based on the `U` box. +* `NULL()` is the group that will disappear from its context, useful for skipping content. It is based on the `U` box. } @benefits{ * Box expressions are a declarative mechanism to express formatting rules that are flexible enough to deal @@ -61,7 +61,7 @@ data Row = R(list[Box] cells); data Alignment = l() | r() | c(); -@synopsis{NULL can be used to return a Box that will completely dissappear in the surrounding context.} +@synopsis{NULL can be used to return a Box that will completely disappear in the surrounding context.} @description{ Consider `NULL()`` as an alternative to producing `H([])` when you see unexpected additional spaces generated. @@ -70,7 +70,7 @@ Typical applications for NULL would be to produce it for layout nodes that conta only whitespace. If you encounter source code comments you can produce the appropriate `L` content, but if you want the position ignored, use `NULL`. -`NULL`` depends on the splicing semantics of `U` to dissappear completely before the layout +`NULL`` depends on the splicing semantics of `U` to disappear completely before the layout algorithm starts counting boxes and widths. } @examples{ diff --git a/src/org/rascalmpl/library/lang/box/util/Box2Text.rsc b/src/org/rascalmpl/library/lang/box/util/Box2Text.rsc index 9ff73f43cfc..08026eaf619 100644 --- a/src/org/rascalmpl/library/lang/box/util/Box2Text.rsc +++ b/src/org/rascalmpl/library/lang/box/util/Box2Text.rsc @@ -114,7 +114,7 @@ This is used during the algorithm, not for external usage. * `vs` is the current separation between vertical elements in V, HV and HOV boxes * `is` is the default (additional) indentation for indented boxes * `maxWidth` is the number of columns (characters) of a single line on screen or on paper -* `wrapAfter` is the threshold criterium for line fullness, to go to the next line in a HV box and to switching +* `wrapAfter` is the threshold criterion for line fullness, to go to the next line in a HV box and to switching between horizontal and vertical for HOV boxes. } data Options = options( @@ -174,15 +174,15 @@ private Text hh([a], Text b) = bar(a, b); private default Text hh(Text a, Text b) = vv(a[0..-1], bar(a[-1], b)); -@synsopsis{Horizontal concatenation, but if the left text is empty return nothing.} +@synopsis{Horizontal concatenation, but if the left text is empty return nothing.} private Text lhh([], Text _) = []; private default Text lhh(a, b) = hh(a, b); -@synsopsis{Horizontal concatenation, but if the right text is empty return nothing.} +@synopsis{Horizontal concatenation, but if the right text is empty return nothing.} private Text rhh(Text _, []) = []; private Text rhh(Text a, Text b) = hh(a, b); -@synsopsis{Vertical concatenation, but if the right text is empty return nothing.} +@synopsis{Vertical concatenation, but if the right text is empty return nothing.} private Text rvv(Text _, []) = []; private default Text rvv(Text a, Text b) = vv(a,b); diff --git a/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc b/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc index f41e812d152..bf580f16f4f 100644 --- a/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc +++ b/src/org/rascalmpl/library/lang/box/util/Tree2Box.rsc @@ -1,4 +1,4 @@ -@synopsis{The default formatting rules for _any_ parsetree.} +@synopsis{The default formatting rules for _any_ parse tree.} @description{ This module is meant to be extended to include rules specific for a language. @@ -221,7 +221,7 @@ default Box toBox(t:appl(Production p, list[Tree] args), FO opts = fo()) { // Now we will deal with a lot of cases for expressions and block-structured statements. // Those kinds of structures appear again and again as many languages share inspiration - // from their pre-decessors. Watching out not to loose any comments... + // from their predecessors. Watching out not to loose any comments... case : return HOV([toBox(elements[0], opts=opts), H([toBox(e, opts=opts) | e <- elements[1..]])]); diff --git a/src/org/rascalmpl/library/lang/csv/IO.rsc b/src/org/rascalmpl/library/lang/csv/IO.rsc index 9f043174944..1e1b3753f71 100644 --- a/src/org/rascalmpl/library/lang/csv/IO.rsc +++ b/src/org/rascalmpl/library/lang/csv/IO.rsc @@ -65,7 +65,7 @@ _Step 2_: The type of each field is inferred from the type of all of its occurre * If all occurrences have a numeric type, then the smallest possible type is used. * If the occurrences have a mixed type, i.e., numeric, non-numeric, boolean or string, then the type is `str`. -* If the requested type for a field is `str` and another type would be inferred by the preceeding two rules, +* If the requested type for a field is `str` and another type would be inferred by the preceding two rules, its inferred type will be `str`. Reading the values in fields is straightforward, except for the case that the text in the field is enclosed between double quotes (`"`): @@ -74,7 +74,7 @@ Reading the values in fields is straightforward, except for the case that the te * the text may contain escaped double quotes (`""`) which are represented as `\"` in the resulting string value. } @examples{ -Given is the follwing file `ex1.csv`: +Given is the following file `ex1.csv`: ```rascal ((|project://rascal/src/org/rascalmpl/library/lang/csv/examples/ex1.csv|)) diff --git a/src/org/rascalmpl/library/lang/java/Compiler.rsc b/src/org/rascalmpl/library/lang/java/Compiler.rsc index 63871892501..941cc05142c 100644 --- a/src/org/rascalmpl/library/lang/java/Compiler.rsc +++ b/src/org/rascalmpl/library/lang/java/Compiler.rsc @@ -57,7 +57,7 @@ list[Message] compileJava(PathConfig pcfg) @pitfalls{ * `file` has to be reachable from `srcs`, because a fully qualified class name is computing by relativizing the source file `loc` against the `srcs` folders. * The source files is read using ((readFile)). -* All classfiles, which could be many in the case of anonymous or nested classes, are written directly to the `bin` folder. +* All class files, which could be many in the case of anonymous or nested classes, are written directly to the `bin` folder. * `libs` is typically a list of `jar+file:///` or `mvn:///` locations, one for each (transitive) compile-time dependency. Without these the compiler will complain about missing symbols and return error messages. } diff --git a/src/org/rascalmpl/library/lang/paths/Unix.rsc b/src/org/rascalmpl/library/lang/paths/Unix.rsc index 4c3a0f2979f..2575f5951dd 100644 --- a/src/org/rascalmpl/library/lang/paths/Unix.rsc +++ b/src/org/rascalmpl/library/lang/paths/Unix.rsc @@ -8,7 +8,7 @@ The main function of this module, ((parseUnixPath)): * throws a ParseError if the path does not comply. * ensures that if the file exists on system A, then the `loc` representation resolves to the same file on system A via any ((Library:module:IO)) function. -* and nothing more. No normalization, no interpretatioon of `.` and `..`, no changing of cases. +* and nothing more. No normalization, no interpretation of `.` and `..`, no changing of cases. This is left to downstream processors of `loc` values, if necessary. The current transformation is purely syntactical, and tries to preserve the semantics of the path as much as possible. } diff --git a/src/org/rascalmpl/library/lang/paths/Windows.rsc b/src/org/rascalmpl/library/lang/paths/Windows.rsc index 2aa288ba59e..20a38c7db41 100644 --- a/src/org/rascalmpl/library/lang/paths/Windows.rsc +++ b/src/org/rascalmpl/library/lang/paths/Windows.rsc @@ -10,12 +10,12 @@ The main function of this module, ((parseWindowsPath)): * throws a ParseError if the path does not comply. Typically file names ending in spaces do not comply. * ensures that if the file exists on system A, then the `loc` representation resolves to the same file on system A via any ((Library:module:IO)) function. -* and nothing more. No normalization, no interpretatioon of `.` and `..`, no changing of cases. +* and nothing more. No normalization, no interpretation of `.` and `..`, no changing of cases. This is left to downstream processors of `loc` values, if necessary. The current transformation is purely syntactical, and tries to preserve the semantics of the path as much as possible. } @pitfalls{ -* Length limitations are not implemnted by this parser. This means that overly long names will lead +* Length limitations are not implemented by this parser. This means that overly long names will lead to IO exceptions when they are finally used. * The names of drives, files and devices are mapped as-is, without normalization. This means that the resulting `loc` value may not be a _canonical_ representation of the identified resource. diff --git a/src/org/rascalmpl/library/lang/rascal/format/Escape.rsc b/src/org/rascalmpl/library/lang/rascal/format/Escape.rsc index 992fca6dc85..ba4c1679377 100644 --- a/src/org/rascalmpl/library/lang/rascal/format/Escape.rsc +++ b/src/org/rascalmpl/library/lang/rascal/format/Escape.rsc @@ -39,7 +39,7 @@ public list[str] ascii = /* 018 */ "\\a12", // DC2 (Device Control 2) /* 019 */ "\\a13", // DC3 (Device Control 3) /* 020 */ "\\a14", // DC4 (Device Control 4) -/* 021 */ "\\a16", // NAK (Negative Acknowledgemnt) +/* 021 */ "\\a16", // NAK (Negative Acknowledgement) /* 022 */ "\\a16", // SYN (Synchronous Idle) /* 023 */ "\\a17", // ETB (End of Trans. Block) /* 024 */ "\\a18", // CAN (Cancel) diff --git a/src/org/rascalmpl/library/lang/rascal/matching/Fingerprint.rsc b/src/org/rascalmpl/library/lang/rascal/matching/Fingerprint.rsc index f57e77ac0ef..7fdcd9e7584 100644 --- a/src/org/rascalmpl/library/lang/rascal/matching/Fingerprint.rsc +++ b/src/org/rascalmpl/library/lang/rascal/matching/Fingerprint.rsc @@ -25,7 +25,7 @@ There are several explicit contracts implemented here: * fingerprints distinguish the identity of the outermost value construct as much as possible. I.e. production rules and constructors are mapped to different codes as much as possible, without breaking the fingerprinting contract. This contract is not automatically tested. Performance regressions may be caused by accidental fingerprinting collisions. - * there is also an equals contract: `value1 equals value2 ==> fingerprint(value1) == fingerprint(value2)`, which is a collorary from the pattern + * there is also an equals contract: `value1 equals value2 ==> fingerprint(value1) == fingerprint(value2)`, which is a corollary from the pattern matching contract if you consider that patterns may also be equality tests. As you can read the computation of fingerprints reuses a lot of internal hashcodes. Mainly these boil down to the hash codes of: diff --git a/src/org/rascalmpl/library/lang/xml/IO.rsc b/src/org/rascalmpl/library/lang/xml/IO.rsc index 5e6a3c7c7fe..628c4708e66 100644 --- a/src/org/rascalmpl/library/lang/xml/IO.rsc +++ b/src/org/rascalmpl/library/lang/xml/IO.rsc @@ -18,7 +18,7 @@ java value readXML(loc file, bool fullyQualify=false, bool trackOrigins = false, ((streamXML)) returns a closure function. When you call it repeatedly, it will produce a single value `just(...)` for each occurrence of `elementName` tags in the input. The final call will produce `nothing()`, so you know when to stop. -`IO` exceptions can still be thrown even when you are already streaming. This means an entire file has dissappeared, +`IO` exceptions can still be thrown even when you are already streaming. This means an entire file has disappeared, or permissions were revoked during the execution of the stream. Only when you receive `nothing()` it is indicated that the `elementName` tag is not further present in the file. } diff --git a/src/org/rascalmpl/library/util/Benchmark.rsc b/src/org/rascalmpl/library/util/Benchmark.rsc index eb6405b0dac..2665ec9e9c2 100644 --- a/src/org/rascalmpl/library/util/Benchmark.rsc +++ b/src/org/rascalmpl/library/util/Benchmark.rsc @@ -140,7 +140,7 @@ Returns the CPU time that the current thread has executed in system mode in nano import util::Benchmark; ``` -Here we measure time by using separate calls to `sytemTime` before and after a call to `fac`. +Here we measure time by using separate calls to `systemTime` before and after a call to `fac`. ```rascal-shell,continue before = systemTime(); @@ -277,7 +277,7 @@ public map[str,num] benchmark(map[str, void()] Cases, int (void ()) duration) -@ynopsis{ +@synopsis{ "Force" a JVM garbage collection. } @description{ diff --git a/src/org/rascalmpl/library/util/Clipboard.rsc b/src/org/rascalmpl/library/util/Clipboard.rsc index f7c9ed20d86..59ccb4f2262 100644 --- a/src/org/rascalmpl/library/util/Clipboard.rsc +++ b/src/org/rascalmpl/library/util/Clipboard.rsc @@ -87,7 +87,7 @@ for the clipboard. This function is thread-friendly, however and will not crash java rel[str humanReadable, str fullMimetype] availableTextMimetypesFor(str shortMimetype); @javaClass{org.rascalmpl.library.util.Clipboard} -@synsopsis{Serializes the current contents of the clipboard that matches the given mimetype to a string} +@synopsis{Serializes the current contents of the clipboard that matches the given mimetype to a string} @description{ This only works for ((availableTextMimetypes)), otherwise an exception is thrown. diff --git a/src/org/rascalmpl/library/util/Eval.rsc b/src/org/rascalmpl/library/util/Eval.rsc index fd9afdfb2a0..daaa76da7c5 100644 --- a/src/org/rascalmpl/library/util/Eval.rsc +++ b/src/org/rascalmpl/library/util/Eval.rsc @@ -17,7 +17,7 @@ import IO; @synopsis{Results encode the output of a call to `eval`} @description{ -* `ok` reflects the execution was succesful while there was no output. For example a call to `println` would produce `ok()`. +* `ok` reflects the execution was successful while there was no output. For example a call to `println` would produce `ok()`. * `result` captures a value of a certain type, which is parameterized as `&T`. } data Result[&T] @@ -25,7 +25,7 @@ data Result[&T] | result(&T val) ; -@synsopsis{Normally static errors are not run-time exceptions, but `eval` wraps them due to its dynamic nature.} +@synopsis{Normally static errors are not run-time exceptions, but `eval` wraps them due to its dynamic nature.} @description{ `eval` will throw the first static error that is blocking the execution of a command. } @@ -65,7 +65,7 @@ e.eval(#void, "println(a)"); * Creating a single run-time engine is an expensive operation. By reusing it you can safe a lot of time and space. Use `.reset()` to reuse the configuration while dropping all other state and returning to an initial runtime. -* The PathConfig parameter completelu defines the configuration of the ((RascalRuntime)). +* The PathConfig parameter completely defines the configuration of the ((RascalRuntime)). } @pitfalls{ * To turn a value string into an actual value, it's better and faster to use ((readTextValueString)) or ((readTextValueFile)). @@ -218,7 +218,7 @@ test bool evalTimeoutWorks() { return true; } -@synsopis{Tests and demonstrates the use of PathConfig to configure a Rascal runtime.} +@synopsis{Tests and demonstrates the use of PathConfig to configure a Rascal runtime.} test bool evalWithOwnPathConfig() { e = createRascalRuntime( pcfg=pathConfig( diff --git a/src/org/rascalmpl/library/util/Monitor.rsc b/src/org/rascalmpl/library/util/Monitor.rsc index 59a6f5aec15..94948a9bec7 100644 --- a/src/org/rascalmpl/library/util/Monitor.rsc +++ b/src/org/rascalmpl/library/util/Monitor.rsc @@ -28,7 +28,7 @@ specific task will be increased by the given amount. } @benefits{ -* It is adviced to use the "block" functions `job` instead of the raw `jobStart`, `jobStep` and `jobEnd` +* It is advised to use the "block" functions `job` instead of the raw `jobStart`, `jobStep` and `jobEnd` functions because these guarantee each started task is always ended, with and without exceptions. This improves the user experience for your users. Also these functions help by providing the job label in the scope of the task, such that this "magic constant" does not need to be repeated. @@ -49,7 +49,7 @@ java void jobStep(str label, str message, int work = 1); java int jobEnd(str label, bool success=true); @javaClass{org.rascalmpl.library.util.Monitor} -@synopsis{Register additional work for the identied job.} +@synopsis{Register additional work for the identified job.} java void jobTodo(str label, int work=1); @javaClass{org.rascalmpl.library.util.Monitor} diff --git a/src/org/rascalmpl/library/util/ParseErrorRecovery.rsc b/src/org/rascalmpl/library/util/ParseErrorRecovery.rsc index 6c84f3790ec..d1d14c75473 100644 --- a/src/org/rascalmpl/library/util/ParseErrorRecovery.rsc +++ b/src/org/rascalmpl/library/util/ParseErrorRecovery.rsc @@ -32,7 +32,7 @@ java bool hasParseErrors(Tree tree); @javaClass{org.rascalmpl.library.util.ParseErrorRecovery} @synopsis{Find all error productions in a parse tree. Note that children of an error tree can contain errors themselves. -The list of errors returned by this methood is created by an outermost visit of the parse tree so if an error tree contains other errors the outermost tree is +The list of errors returned by this method is created by an outermost visit of the parse tree so if an error tree contains other errors the outermost tree is returned first. Often error trees are highly ambiguous and can contain a lot of error trees. This function is primarily used to analyze small examples as calling this function on a tree with many errors will result in long runtimes and out-of-memory errors. diff --git a/src/org/rascalmpl/library/util/PathConfig.rsc b/src/org/rascalmpl/library/util/PathConfig.rsc index 644e9edcc05..e5d070a3a9a 100644 --- a/src/org/rascalmpl/library/util/PathConfig.rsc +++ b/src/org/rascalmpl/library/util/PathConfig.rsc @@ -34,7 +34,7 @@ import util::UUID; @description{ A PathConfig is the result of dependency resolution and other configuration steps. Typically, IDEs produce the information to fill a PathConfig, such that language tools can consume it -transparantly. A PathConfig is also a log of the configuration process. Typically a single +transparently. A PathConfig is also a log of the configuration process. Typically a single ((pathConfig)) instance configures the language processor for a single source project tree. * `projectRoot` is the root directory of the source project tree that is being configured. diff --git a/src/org/rascalmpl/library/util/PriorityQueue.rsc b/src/org/rascalmpl/library/util/PriorityQueue.rsc index ca443433d0e..58ce424eb23 100644 --- a/src/org/rascalmpl/library/util/PriorityQueue.rsc +++ b/src/org/rascalmpl/library/util/PriorityQueue.rsc @@ -44,7 +44,7 @@ module util::PriorityQueue * - PriorityQueue insertElement(PriorityQueue Q, int priority, int val): * insert pair in queue. * - int findMinimum(PriorityQueue Q): - * find the minmium priority. + * find the minimum priority. * - tuple[int, int, PriorityQueue] extractMinimum(PriorityQueue Q): * find the pair with minimum priority and delete it. */ diff --git a/src/org/rascalmpl/library/util/Progress.rsc b/src/org/rascalmpl/library/util/Progress.rsc index e0b64a425cb..aee8a8bac85 100644 --- a/src/org/rascalmpl/library/util/Progress.rsc +++ b/src/org/rascalmpl/library/util/Progress.rsc @@ -13,21 +13,21 @@ import String; import IO; import util::Math; -@synopsis{This progressbar can be used in terminal applications to show the progress of some process in the terminal.} +@synopsis{This progress bar can be used in terminal applications to show the progress of some process in the terminal.} @description{ The total number of steps is the only required parameter to be passed in. All other parameters are optional. - `prefix` is the string that is displayed in front of the progress bar (default ""). - `length` is the length (number of characters) of the displayed bar (default 50). - - `limit` allows for the throtteling of the number of times the progress bar is printed. For instance if the total is 1000 and the limit is set to 100 then the progress bar will be updated every 10 iterations. + - `limit` allows for the throttling of the number of times the progress bar is printed. For instance if the total is 1000 and the limit is set to 100 then the progress bar will be updated every 10 iterations. - `fill` is the character used for the percentage used (default "\u2588"). - `unfill` is the character used for the unused part (default "-"). - `printEnd` is the character used at the end of the line (default "\r"). The return is a tuple with 2 functions, the `report` and the `finished` function. - - `report(str suffix)` needs to be called for every iteration update. The suffix is displayed after the progressbar and can differ per iteration + - `report(str suffix)` needs to be called for every iteration update. The suffix is displayed after the progress bar and can differ per iteration - `finished()` can be called at the end of the iteration to add a new line to the terminal - It is inspired on the progressbar described here: https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console + It is inspired on the progress bar described here: https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console } tuple[void(str) report, void() finished] progressBar(int total, str prefix = "Progress:", int length = 50, int limit = total, str fill = "\u2588", str unfill = "-", str printEnd = "\r") { limit = limit > total ? total : limit; diff --git a/src/org/rascalmpl/library/util/Reflective.rsc b/src/org/rascalmpl/library/util/Reflective.rsc index b73bacb487a..4140497f582 100644 --- a/src/org/rascalmpl/library/util/Reflective.rsc +++ b/src/org/rascalmpl/library/util/Reflective.rsc @@ -31,10 +31,10 @@ public java str getLineSeparator(); @javaClass{org.rascalmpl.library.util.Reflective} public java lrel[str result, str out, str err] evalCommands(list[str] command, loc org); -@synopsis{Just parse a module at a given location without any furter processing (i.e., fragment parsing) or side-effects (e.g. module loading)} +@synopsis{Just parse a module at a given location without any further processing (i.e., fragment parsing) or side-effects (e.g. module loading)} public lang::rascal::\syntax::Rascal::Module parseModule(loc location) = parseModuleWithSpaces(location).top; -@synopsis{Parse a module (including surounding spaces) at a given location without any furter processing (i.e., fragment parsing) or side-effects (e.g. module loading)} +@synopsis{Parse a module (including surrounding spaces) at a given location without any further processing (i.e., fragment parsing) or side-effects (e.g. module loading)} @javaClass{org.rascalmpl.library.util.Reflective} public java start[Module] parseModuleWithSpaces(loc location); diff --git a/src/org/rascalmpl/library/util/ShellExec.rsc b/src/org/rascalmpl/library/util/ShellExec.rsc index e04c8a9a873..aaca7177054 100644 --- a/src/org/rascalmpl/library/util/ShellExec.rsc +++ b/src/org/rascalmpl/library/util/ShellExec.rsc @@ -11,7 +11,7 @@ module util::ShellExec @synopsis{Start a new external process.} -@deprecrated{ +@deprecated{ Use the createProcess function that takes `loc` for processCommand for better portability behavior between operating systems. } @javaClass{org.rascalmpl.library.util.ShellExec} @@ -35,7 +35,7 @@ For environment variables in `envVars` the same treatment is given to convert va java PID createProcess(loc processCommand, loc workingDir=|cwd:///|, list[value] args = [], map[str, value] envVars = ()); @synopsis{start, run and kill an external process returning its output as a string.} -@deprecrated{ +@deprecated{ Use the `exec`` function that takes `loc` for processCommand for better portability behavior between operating systems. } str exec(str processCommand, loc workingDir=|cwd:///|, list[str] args = [], map[str, str] env = ()) { @@ -53,7 +53,7 @@ str exec(loc processCommand, loc workingDir=|cwd:///|, list[value] args = [], ma return result; } -@deprecrated{ +@deprecated{ Use the `execWithCode` function that takes `loc` for processCommand for better portability behavior between operating systems. } tuple[str output, int exitCode] execWithCode(str processCommand, loc workingDir=|cwd:///|, list[str] args = [], map[str, str] env = ()) { diff --git a/src/org/rascalmpl/library/util/UUID.rsc b/src/org/rascalmpl/library/util/UUID.rsc index 7936c7d1090..3a3fcb33d55 100644 --- a/src/org/rascalmpl/library/util/UUID.rsc +++ b/src/org/rascalmpl/library/util/UUID.rsc @@ -18,7 +18,7 @@ The uuid() function generates a location with the authority showing the literal uuid() ``` -Use it to relate identies to data objects, as in this example which adds a field to a relation: +Use it to relate identities to data objects, as in this example which adds a field to a relation: ```rascal-shell,continue myData = { | i <- [1..11] }; diff --git a/src/org/rascalmpl/library/vis/Charts.rsc b/src/org/rascalmpl/library/vis/Charts.rsc index 6d6944aa922..f732883540b 100644 --- a/src/org/rascalmpl/library/vis/Charts.rsc +++ b/src/org/rascalmpl/library/vis/Charts.rsc @@ -66,7 +66,7 @@ import Content; import Set; import List; -@synopsis{A scatterplot from a binary numerical relation.} +@synopsis{A scatter plot from a binary numerical relation.} Content scatterChart(lrel[num x,num y] v, str title="Scatterplot", ChartAutoColorMode colorMode=\dataset()) = content(title, chartServer(chartData(title, v), \type=scatter(), title=title, colorMode=colorMode, legend=false)); @@ -80,7 +80,7 @@ Content scatterChart(rel[num x ,num y] v, str title="Scatterplot", ChartAutoColo Content scatterChart(list[str] labels, rel[num x,num y] values ..., str title="Scatterplots", ChartAutoColorMode colorMode=\dataset()) = content(title, chartServer(chartData(labels, values), \type=scatter(), title=title, colorMode=colorMode)); -@synopsis{A bubblechart from a binary numerical list relation.} +@synopsis{A bubble chart from a binary numerical list relation.} @pitfalls{ * the radius is in raw pixels rather than scaled to the chart's axis } @@ -161,7 +161,7 @@ Content pieChart(list[str] labels, rel[str label, num val] values..., str title= Content pieChart(list[str] labels, lrel[str label, num val] values..., str title="Pie Chart", ChartAutoColorMode colorMode=\dataset()) = content(title, chartServer(chartData(labels, values), \type=\pie(), title=title, colorMode=colorMode, legend=true)); -@synopsis{A dougnut chart from labeled numbers} +@synopsis{A doughnut chart from labeled numbers} Content doughnutChart(rel[str label, num val] values, str title="Doughnut Chart", ChartAutoColorMode colorMode=\data()) = content(title, chartServer(chartData(values), \type=\doughnut(), title=title, colorMode=colorMode, legend=true)); @@ -334,7 +334,7 @@ data ChartData The `data` field is a list of supported values, of which the constraints are not expressible by data types. These are currently supported: -* ((ChartDataPoint)), with an without a `r`adius +* ((ChartDataPoint)), with and without a `r`adius * `num`, but within `double` precision (!) and no `rat` } data ChartDataSet( diff --git a/src/org/rascalmpl/library/vis/Graphs.rsc b/src/org/rascalmpl/library/vis/Graphs.rsc index 2da30566e75..8d0a2e30b0b 100644 --- a/src/org/rascalmpl/library/vis/Graphs.rsc +++ b/src/org/rascalmpl/library/vis/Graphs.rsc @@ -51,7 +51,7 @@ the original input `Graph[&T]`; so that is the type of the nodes. Often this wou Let's experiment with a number of styling parameters based on the shape of a graph: ```rascal-shell import vis::Graphs; -// let's play with the geneology of the "Simpsons" +// let's play with the genealogy of the "Simpsons" g = { <"Abraham Simpson", "Homer Simpson">, <"Mona Simpson", "Homer Simpson">, @@ -126,7 +126,7 @@ alias NodeLinker[&T] = loc (&T _id1); loc defaultNodeLinker(/loc l) = l; default loc defaultNodeLinker(&T _) = |nothing:///|; -@synopsis{A NodeLabeler maps node identies to descriptive node labels} +@synopsis{A NodeLabeler maps node identities to descriptive node labels} alias NodeLabeler[&T]= str (&T _id2); @synopsis{The default node labeler searches for any `str`` in the identity, or otherwise a file name of a `loc`} @@ -146,7 +146,7 @@ alias EdgeClassifier[&T] = list[str] (&T _from, &T _to); @synopsis{The default edge classifier produces no classes} list[str] defaultEdgeClassifier(&T _, &T _) = []; -@synopsis{An EdgeLabeler maps edge identies to descriptive edge labels.} +@synopsis{An EdgeLabeler maps edge identities to descriptive edge labels.} alias EdgeLabeler[&T]= str (&T _source, &T _target); @synopsis{The default edge labeler returns the empty label for all edges.} @@ -205,7 +205,7 @@ graph({ | x <- [1..100]} + {<100,101,1>}) Content graph(rel[&T x, &L edge, &T y] v, CytoGraphConfig cfg=cytoGraphConfig()) = content(cfg.title, graphServer(cytoscape(graphData(v, cfg=cfg), cfg=cfg))); -@synopsis{This core workhorse mixes the graph data with the configuration to obtain visualizable CytoScape.js data-structure.} +@synopsis{This core workhorse mixes the graph data with the configuration to obtain a visualizable CytoScape.js data-structure.} @description{ This data-structure is serialized to JSON and communicated directly to initialize cytoscape.js. The serialization is done by the generic ((lang::json::IO)) library under the hood of a ((util::Webserver)). @@ -516,7 +516,7 @@ is typically used for an initial exploration of the graph. It is very fast. circle is arbitrary. This layout fails on larger collections of nodes because the points on the circle will become really small and indistinguishable. However for graphs with less than 100 nodes it provides a quick and natural overview. -* `breadthfirst` computes a breadthfirst spanning tree, and uses path length to decide on which +* `breadthfirst` computes a breadth-first spanning tree, and uses path length to decide on which layer each node will reside. Cross-edges (between branches) and back-edges are allowed but if there are many the graph will be messy. So this layout is best when you have a mostly hierarchical graph. Examples are flow charts and dependency graphs.