-
Notifications
You must be signed in to change notification settings - Fork 40
Description
文法エラーや実行時エラーといった AiScriptError について、メッセージの書き方に一貫性がない。
- 最初の文字が大文字になっているか、最後にピリオドがついているか
- 小文字 ピリオドなし
aiscript/src/parser/syntaxes/common.ts
Line 83 in d6106b8
throw new AiScriptSyntaxError('separator expected', s.getPos());
- 小文字 ピリオドあり
aiscript/src/parser/syntaxes/statements.ts
Line 393 in d6106b8
throw new AiScriptSyntaxError('invalid attribute.', statement.loc.start);
- 大文字 ピリオドなし
aiscript/src/interpreter/primitive-props.ts
Line 251 in d6106b8
if (!withInitialValue && (target.value.length === 0)) throw new AiScriptRuntimeError('Reduce of empty array without initial value');
- 大文字 ピリオドあり
aiscript/src/parser/syntaxes/expressions.ts
Line 561 in d6106b8
throw new AiScriptSyntaxError('Cannot use spaces in a reference.', s.getPos());
- 小文字 ピリオドなし
- 変数が何で囲われているか
- なし
Line 40 in d6106b8
return new AiScriptSyntaxError(`unexpected token: ${TokenKind[token]}`, pos, info);
'Line 202 in d6106b8
throw new AiScriptSyntaxError(`Unknown type: '${getTypeNameBySource(typeSource)}'`, typeSource.loc.start);
"throw new AiScriptSyntaxError(`Reserved word "${name}" cannot be used as variable name.`, pos);
()aiscript/src/interpreter/primitive-props.ts
Line 534 in d6106b8
throw new AiScriptRuntimeError(`No such prop (${name}) in ${target.type}.`);
- なし
assertBoolean,assertFunctionなどの関数が投げるエラーのメッセージ内にある型の名前がValue.typeで定義されたものと異なるbooleanaiscript/src/interpreter/util.ts
Line 44 in d6106b8
throw new AiScriptRuntimeError(`Expect boolean, but got ${val.type}.`);
boolaiscript/src/interpreter/value.ts
Lines 9 to 12 in d6106b8
export type VBool = { type: 'bool'; value: boolean; };
- プロパティアクセスができない型に対してプロパティアクセスをしたときのエラーメッセージが、インデックスアクセスができない型に対してインデックスアクセスをしたときのメッセージと異なる語順になっている
- プロパティアクセス
aiscript/src/interpreter/primitive-props.ts
Line 537 in d6106b8
throw new AiScriptRuntimeError(`Cannot read prop of ${target.type}. (reading ${name})`);
- インデックスアクセス
aiscript/src/interpreter/index.ts
Line 795 in d6106b8
throw new AiScriptRuntimeError(`Cannot read prop (${reprValue(i)}) of ${target.type}.`);
- プロパティアクセス
- 予期したものと異なるものが与えられたときのエラーメッセージに but が含まれるか
- なし
aiscript/src/interpreter/primitive-props.ts
Line 395 in d6106b8
if (times.value < 0) throw new AiScriptRuntimeError('arr.repeat expected non-negative number, got negative');
- あり
aiscript/src/interpreter/util.ts
Line 7 in d6106b8
throw new AiScriptRuntimeError('Expect anything, but got nothing.');
- なし