Skip to content

Commit d110ec0

Browse files
committed
consistency within comments
1 parent 745286f commit d110ec0

22 files changed

+54
-54
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ More things to remember:
5858
- Keep the source code as runtime agnostic as possible. We target the browser
5959
and Deno. This is necessary because we use `deno test`. If a module is
6060
exclusive to one runtime, add a note above the code:
61-
`// This code is browser/Deno only`.
61+
`// this code is browser/Deno only`.
6262

6363
(The following aren't strict rules. It's perfectly fine to not follow any of
6464
these for any reason e.g. you just want to fix typo.)

build/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import * as ESBuild from "esbuild";
44
import * as Dictionary from "../dictionary/build.ts";

build/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { denoPlugins } from "@luca/esbuild-deno-loader";
44
import { BuildOptions } from "esbuild";

build/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { assert } from "@std/assert/assert";
44
import { exists } from "@std/fs/exists";

dictionary/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
// deno-lint-ignore-file no-console
44

@@ -19,7 +19,7 @@ export async function buildWithDictionary(
1919
2,
2020
);
2121
const code = `\
22-
// This code is autogenerated
22+
// this code is autogenerated
2323
2424
import { Dictionary } from "./type.ts";
2525
@@ -68,7 +68,7 @@ function displayError(source: string, errors: ReadonlyArray<ArrayResultError>) {
6868
if (error instanceof PositionedError && error.position != null) {
6969
const { position, length } = error.position;
7070
const end = position + length;
71-
// The only instance returning -1 is useful
71+
// the only instance returning -1 is useful
7272
const startLine = source.lastIndexOf("\n", position) + 1;
7373
let currentLine = startLine;
7474
let currentPosition = position;

dictionary/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { assertMatch } from "@std/assert/match";
44
import { dictionary } from "./dictionary.ts";

dictionary/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { unreachable } from "@std/assert/unreachable";
44
import { debounce } from "@std/async/debounce";

misc/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Ensure this module don't have imports and as runtime agnostic as possible,
1+
// ensure this module don't have imports and as runtime agnostic as possible,
22
// make separate module when necessary
33

44
export function nullableAsArray<T>(value?: T): ReadonlyArray<NonNullable<T>> {

src/array_result.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ArrayResult<T> {
9898
& Readonly<{ [I in keyof T]: ArrayResult<T[I]> }>
9999
& Readonly<{ length: T["length"] }>
100100
): ArrayResult<T> {
101-
// We resorted to using `any` types here, make sure it works properly
101+
// we resorted to using `any` types here, make sure it works properly
102102
return arrayResults.reduce(
103103
(left: ArrayResult<any>, right) => {
104104
if (left.isError() && right.isError()) {

src/dictionary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { dictionary as globalDictionary } from "../dictionary/dictionary.ts";
22
import { Definition, Dictionary } from "../dictionary/type.ts";
33
import { load } from "../telo_misikeke/telo_misikeke.js";
44

5-
// All of these global constants are mutable
5+
// all of these global constants are mutable
66

77
const customDictionary: Dictionary = new Map();
88
export const dictionary: Dictionary = new Map();

src/examples.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Examples gathered from https://github.com/kilipan/nasin-toki
1+
// examples gathered from https://github.com/kilipan/nasin-toki
22
// CC-BY-SA 4.0 https://github.com/kilipan/nasin-toki/blob/main/LICENSE.txt
33
export const EXAMPLE_SENTENCES = [
44
"anu seme",
@@ -189,7 +189,7 @@ export const EXAMPLE_SENTENCES = [
189189
"mi alasa sitelen e lipu pona",
190190
"jan sona li alasa sona e ijo mute",
191191
];
192-
// Examples taken from https://telo-misikeke.gitlab.io/
192+
// examples taken from https://telo-misikeke.gitlab.io/
193193
export const MALFORMED_SENTENCES = [
194194
"mi jan Nikola, li kama pana e lukin pi ilo ni tawa sini.",
195195
"mi pona, taso, toki mi li ken pi ike.",

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// This code is browser only
1+
// this code is browser only
22

3-
// This is defined by esbuild
3+
// this is defined by esbuild
44
declare const LIVE_RELOAD: boolean;
55

66
// auto-refresh when source code have changed

src/parser/filter.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
import { UnrecognizedError } from "./parser_lib.ts";
2323

2424
export const WORD_UNIT_RULES: ReadonlyArray<(wordUnit: WordUnit) => boolean> = [
25-
// avoid "seme ala seme"
25+
// disallow "seme ala seme"
2626
(wordUnit) =>
2727
wordUnit.type !== "x ala x" || wordUnit.word !== "seme" ||
2828
throwError(new UnrecognizedError('"seme ala seme"')),
@@ -100,29 +100,29 @@ export const MODIFIER_RULES: ReadonlyArray<(modifier: Modifier) => boolean> = [
100100
export const MULTIPLE_MODIFIERS_RULES: ReadonlyArray<
101101
(modifier: ReadonlyArray<Modifier>) => boolean
102102
> = [
103-
// // no multiple pi
103+
// // disallow multiple pi
104104
// (modifiers) =>
105105
// modifiers.filter(({type}) => type === "pi").length <= 1 ||
106106
// throwError(new UnrecognizedError("multiple pi")),
107107

108-
// no multiple nanpa
108+
// disallow multiple nanpa
109109
(modifiers) =>
110110
modifiers.filter(({ type }) => type === "nanpa").length <= 1 ||
111111
throwError(new UnrecognizedError("multiple nanpa")),
112112

113-
// no multiple proper words
113+
// disallow multiple proper words
114114
(modifiers) =>
115115
modifiers
116116
.filter(({ type }) => type === "proper words")
117117
.length <= 1 ||
118118
throwError(new UnrecognizedError("multiple proper words")),
119119

120-
// no multiple number words
120+
// disallow multiple number words
121121
(modifiers) =>
122122
modifiers.filter(modifierIsNumeric).length <= 1 ||
123123
throwError(new UnrecognizedError("multiple number words")),
124124

125-
// avoid duplicate modifiers when disabled by settings
125+
// disallow duplicate modifiers when disabled by settings
126126
(modifiers) => {
127127
if (settings.separateRepeatedModifiers) {
128128
return true;
@@ -167,32 +167,32 @@ export const MULTIPLE_MODIFIERS_RULES: ReadonlyArray<
167167
},
168168
];
169169
export const PHRASE_RULE: ReadonlyArray<(phrase: Phrase) => boolean> = [
170-
// Disallow preverb modifiers other than "ala"
170+
// disallow preverb modifiers other than "ala"
171171
(phrase) =>
172172
phrase.type !== "preverb" || modifiersIsAlaOrNone(phrase.modifiers) ||
173173
throwError(
174174
new UnrecognizedError('preverb with modifiers other than "ala"'),
175175
),
176176

177-
// No multiple number words
177+
// disallow multiple number words
178178
(phrase) =>
179179
phrase.type !== "default" ||
180180
phrase.headWord.type !== "number" ||
181181
!phrase.modifiers.some(modifierIsNumeric) ||
182182
throwError(new UnrecognizedError("multiple number words")),
183183

184-
// If the phrase has no modifiers, avoid emphasis particle
184+
// if the phrase has no modifiers, disallow emphasis particle
185185
(phrase) =>
186186
phrase.type !== "default" ||
187187
phrase.emphasis == null ||
188188
phrase.modifiers.length > 0,
189189

190-
// For preverbs, inner phrase must not have emphasis particle
190+
// for preverbs, inner phrase must not have emphasis particle
191191
(phrase) =>
192192
phrase.type !== "preverb" ||
193193
!phraseHasTopLevelEmphasis(phrase.phrase),
194194

195-
// Emphasis must not be nested
195+
// emphasis must not be nested
196196
(phrase) =>
197197
phrase.emphasis == null ||
198198
everyWordUnitInPhrase(phrase)
@@ -201,29 +201,29 @@ export const PHRASE_RULE: ReadonlyArray<(phrase: Phrase) => boolean> = [
201201
];
202202
export const PREPOSITION_RULE: ReadonlyArray<(phrase: Preposition) => boolean> =
203203
[
204-
// Disallow preverb modifiers other than "ala"
204+
// disallow preverb modifiers other than "ala"
205205
(preposition) =>
206206
modifiersIsAlaOrNone(preposition.modifiers) ||
207207
throwError(
208208
new UnrecognizedError('preverb with modifiers other than "ala"'),
209209
),
210210

211-
// Disallow nested preposition
211+
// disallow nested preposition
212212
(preposition) =>
213213
!everyPhraseInMultiplePhrases(preposition.phrases)
214214
.some(hasPrepositionInPhrase) ||
215215
throwError(new UnrecognizedError("preposition inside preposition")),
216216

217-
// Preposition with "anu" must not have emphasis particle
217+
// preposition with "anu" must not have emphasis particle
218218
(preposition) =>
219219
preposition.emphasis == null || preposition.phrases.type !== "anu",
220220

221-
// Inner phrase must not have emphasis particle
221+
// inner phrase must not have emphasis particle
222222
(preposition) =>
223223
preposition.phrases.type !== "single" ||
224224
!phraseHasTopLevelEmphasis(preposition.phrases.phrase),
225225

226-
// Emphasis must not be nested
226+
// emphasis must not be nested
227227
(preposition) =>
228228
preposition.emphasis == null ||
229229
everyWordUnitInPreposition(preposition)
@@ -233,10 +233,10 @@ export const PREPOSITION_RULE: ReadonlyArray<(phrase: Preposition) => boolean> =
233233
export const CONTEXT_CLAUSE_RULE: ReadonlyArray<
234234
(contextClause: ContextClause) => boolean
235235
> = [
236-
// Only allow "anu la" when allowed by the settings
236+
// only allow "anu la" when allowed by the settings
237237
(clause) => clause.type !== "anu" || settings.hardcodedAnuLa,
238238

239-
// Prevent "anu ala anu la"
239+
// disallow "anu ala anu la"
240240
(clause) =>
241241
clause.type !== "anu" || clause.anu.type !== "x ala x" ||
242242
throwError(new UnrecognizedError('"anu ala anu la"')),
@@ -309,7 +309,7 @@ export const CLAUSE_RULE: ReadonlyArray<(clause: Clause) => boolean> = [
309309
},
310310
];
311311
export const SENTENCE_RULE: ReadonlyArray<(sentence: Sentence) => boolean> = [
312-
// Prevent "taso ala taso" or "kin ala kin"
312+
// disallow "taso ala taso" or "kin ala kin"
313313
(sentence) => {
314314
if (sentence.type === "default") {
315315
if (
@@ -322,7 +322,7 @@ export const SENTENCE_RULE: ReadonlyArray<(sentence: Sentence) => boolean> = [
322322
}
323323
return true;
324324
},
325-
// If there is "la", there can't be starting particle e.g. taso
325+
// if there is "la", there can't be starting particle e.g. taso
326326
(sentence) =>
327327
sentence.type !== "default" || sentence.contextClauses.length === 0 ||
328328
sentence.startingParticle == null || throwError(
@@ -331,7 +331,7 @@ export const SENTENCE_RULE: ReadonlyArray<(sentence: Sentence) => boolean> = [
331331
),
332332
),
333333

334-
// There can't be more than 1 "x ala x" or "seme"
334+
// there can't be more than 1 "x ala x" or "seme"
335335
(sentence) => {
336336
if (sentence.interrogative != null) {
337337
const interrogative = everyWordUnitInSentence(sentence)
@@ -358,7 +358,7 @@ export const SENTENCE_RULE: ReadonlyArray<(sentence: Sentence) => boolean> = [
358358
export const MULTIPLE_SENTENCES_RULE: ReadonlyArray<
359359
(sentences: ReadonlyArray<Sentence>) => boolean
360360
> = [
361-
// Only allow at most 2 sentences
361+
// only allow at most 2 sentences
362362
(sentences) =>
363363
sentences.filter(({ type }) => type !== "filler").length <= 2 ||
364364
throwError(new UnrecognizedError("multiple sentences")),

src/parser/parser_lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export function sequence<T extends ReadonlyArray<unknown>>(
180180
1,
181181
"`sequence` called with less than 2 arguments",
182182
);
183-
// We resorted to using `any` types here, make sure it works properly
183+
// we resorted to using `any` types here, make sure it works properly
184184
return sequence.reduceRight(
185185
(right: Parser<any>, left) =>
186186
left.then((value) => right.map((newValue) => [value, ...newValue])),

src/parser/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { assertEquals } from "@std/assert/equals";
44
import { assertLess } from "@std/assert/less";

src/repl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { unescape } from "@std/html/entities";
44
import entityList from "@std/html/named-entity-list.json" with { type: "json" };

src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export const defaultSettings: Readonly<Settings> = Object.freeze({
2222
separateRepeatedModifiers: false,
2323
hardcodedAnuLa: true,
2424
});
25-
// This global constant is mutable
25+
// this global constant is mutable
2626
export const settings: Settings = Object.seal({ ...defaultSettings });

src/settings_frontend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is browser only
1+
// this code is browser only
22

33
import { toKebabCase } from "@std/text/to-kebab-case";
44
import { checkLocalStorage, setIgnoreError } from "./local_storage.ts";

src/translator/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { assertArrayIncludes } from "@std/assert/array-includes";
44
import { number } from "./number.ts";

telo_misikeke/Parser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// This code is from https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/-/raw/main/public/Parser.js
1+
// this code is from https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/-/raw/main/public/Parser.js
22
//
3-
// Repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
3+
// repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
44
// Copyright (c) 2023 Nicolas Hurtubise
55
// MIT License https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/#licence
66
//
7-
// It is automatically modified to be an ES module
7+
// it is automatically modified to be an ES module
88

99
/* Parser.js
1010
* written by Colin Kuebler 2012

telo_misikeke/rules.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// This code is from https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/-/raw/main/public/rules.js
1+
// this code is from https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/-/raw/main/public/rules.js
22
//
3-
// Repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
3+
// repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
44
// Copyright (c) 2023 Nicolas Hurtubise
55
// MIT License https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/#licence
66
//
7-
// It is automatically modified to be an ES module
7+
// it is automatically modified to be an ES module
88

99
var getCategory;
1010
var getMessage;

telo_misikeke/update.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This code is Deno only
1+
// this code is Deno only
22

33
import { retry } from "@std/async/retry";
44

@@ -40,13 +40,13 @@ async function buildCode(
4040
}
4141
const exports = exportItems.join(", ");
4242
const code = `\
43-
// This code is from ${source}
43+
// this code is from ${source}
4444
//
45-
// Repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
45+
// repository: https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/
4646
// Copyright (c) 2023 Nicolas Hurtubise
4747
// MIT License https://gitlab.com/telo-misikeke/telo-misikeke.gitlab.io/#licence
4848
//
49-
// It is automatically modified to be an ES module
49+
// it is automatically modified to be an ES module
5050
5151
${withoutCjs};
5252
export { ${exports} };

0 commit comments

Comments
 (0)