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