summaryrefslogtreecommitdiff
path: root/src/client/scripts/hpml/expr.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-11-13 12:23:49 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-11-13 12:23:49 +0900
commit2795fe457909c687f668d020ef65d52abc3182fb (patch)
tree0a52e4e4d854333496fcc487560c93c3de5d5eb5 /src/client/scripts/hpml/expr.ts
parentMerge branch 'develop' (diff)
parent12.96.0 (diff)
downloadmisskey-2795fe457909c687f668d020ef65d52abc3182fb.tar.gz
misskey-2795fe457909c687f668d020ef65d52abc3182fb.tar.bz2
misskey-2795fe457909c687f668d020ef65d52abc3182fb.zip
Merge branch 'develop'
Diffstat (limited to 'src/client/scripts/hpml/expr.ts')
-rw-r--r--src/client/scripts/hpml/expr.ts79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/client/scripts/hpml/expr.ts b/src/client/scripts/hpml/expr.ts
deleted file mode 100644
index 00e3ed118b..0000000000
--- a/src/client/scripts/hpml/expr.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { literalDefs, Type } from '.';
-
-export type ExprBase = {
- id: string;
-};
-
-// value
-
-export type EmptyValue = ExprBase & {
- type: null;
- value: null;
-};
-
-export type TextValue = ExprBase & {
- type: 'text';
- value: string;
-};
-
-export type MultiLineTextValue = ExprBase & {
- type: 'multiLineText';
- value: string;
-};
-
-export type TextListValue = ExprBase & {
- type: 'textList';
- value: string;
-};
-
-export type NumberValue = ExprBase & {
- type: 'number';
- value: number;
-};
-
-export type RefValue = ExprBase & {
- type: 'ref';
- value: string; // value is variable name
-};
-
-export type AiScriptRefValue = ExprBase & {
- type: 'aiScriptVar';
- value: string; // value is variable name
-};
-
-export type UserFnValue = ExprBase & {
- type: 'fn';
- value: UserFnInnerValue;
-};
-type UserFnInnerValue = {
- slots: {
- name: string;
- type: Type;
- }[];
- expression: Expr;
-};
-
-export type Value =
- EmptyValue | TextValue | MultiLineTextValue | TextListValue | NumberValue | RefValue | AiScriptRefValue | UserFnValue;
-
-export function isLiteralValue(expr: Expr): expr is Value {
- if (expr.type == null) return true;
- if (literalDefs[expr.type]) return true;
- return false;
-}
-
-// call function
-
-export type CallFn = ExprBase & { // "fn:hoge" or string
- type: string;
- args: Expr[];
- value: null;
-};
-
-// variable
-export type Variable = (Value | CallFn) & {
- name: string;
-};
-
-// expression
-export type Expr = Variable | Value | CallFn;