From 1142ae5065fd47137943be51dccc274e34878ef7 Mon Sep 17 00:00:00 2001 From: Xie Yuheng Date: Fri, 15 Nov 2024 16:11:31 +0800 Subject: [PATCH] move example code to examples --- README.md | 4 ++-- docs/articles/programming-with-interaction-nets.md | 10 +++++----- ...345\272\224\347\275\221\347\274\226\347\250\213.md" | 10 +++++----- {docs/std => examples}/datatype/Bin.i | 0 {docs/std => examples}/datatype/Bin.test.i | 0 {docs/std => examples}/datatype/Bin.test.i.out | 0 {docs/std => examples}/datatype/DiffList.i | 0 {docs/std => examples}/datatype/DiffList.test.i | 0 {docs/std => examples}/datatype/DiffList.test.i.out | 0 {docs/std => examples}/datatype/List.i | 0 {docs/std => examples}/datatype/List.test.i | 0 {docs/std => examples}/datatype/List.test.i.out | 0 {docs/std => examples}/datatype/Nat.i | 0 {docs/std => examples}/datatype/Nat.test.i | 0 {docs/std => examples}/datatype/Nat.test.i.out | 0 {docs/std => examples}/datatype/Pair.i | 0 {docs/std => examples}/datatype/Pair.i.out | 0 {docs/std => examples}/datatype/Trivial.i | 0 .../tests/builtin/connect-args.error.i | 0 .../tests/builtin/connect-args.error.i.err | 0 .../tests/builtin/connect-type.error.i | 0 .../tests/builtin/connect-type.error.i.err | 0 .../tests/builtin/inspect-args.error.i | 0 .../tests/builtin/inspect-args.error.i.err | 0 .../tests/currying/function-extra-one-arg.i | 0 .../tests/currying/function-extra-one-arg.i.out | 0 .../tests/currying/function-not-enough-args.i | 0 .../tests/currying/function-not-enough-args.i.out | 0 .../tests/currying/node-extra-one-arg.i | 0 .../tests/currying/node-extra-one-arg.i.out | 0 .../tests/currying/node-not-enough-args.i | 0 .../tests/currying/node-not-enough-args.i.out | 0 .../linearity/function-variable-double-use.error.i | 0 .../linearity/function-variable-double-use.error.i.err | 0 .../tests/linearity/function-variable-not-used.error.i | 0 .../linearity/function-variable-not-used.error.i.err | 0 .../tests/linearity/rule-variable-not-used.error.i | 0 .../tests/linearity/rule-variable-not-used.error.i.err | 0 .../tests/module/circular-import-1.error.i | 0 .../tests/module/circular-import-1.error.i.err | 4 ++-- .../tests/module/circular-import-2.error.i | 0 .../tests/module/circular-import-2.error.i.err | 4 ++-- .../tests/module/circular-import-3.error.i | 0 .../tests/module/circular-import-3.error.i.err | 4 ++-- .../tests/module/circular-require-1.error.i | 0 .../tests/module/circular-require-1.error.i.err | 4 ++-- .../tests/module/circular-require-2.error.i | 0 .../tests/module/circular-require-2.error.i.err | 4 ++-- .../tests/module/circular-require-3.error.i | 0 .../tests/module/circular-require-3.error.i.err | 4 ++-- {docs/std => examples}/tests/module/import.i | 0 {docs/std => examples}/tests/module/import.i.out | 0 .../tests/module/require-already-defined.error.i | 0 .../tests/module/require-already-defined.error.i.err | 0 {docs/std => examples}/tests/module/require.i | 0 {docs/std => examples}/tests/module/require.i.out | 0 .../tests/module/reuqire-more-rules-1.i | 0 .../tests/module/reuqire-more-rules-2.i | 0 .../tests/module/reuqire-more-rules-3.i | 0 .../tests/module/reuqire-more-rules-3.i.out | 0 .../std => examples}/tests/module/self-import.error.i | 0 .../tests/module/self-import.error.i.err | 4 ++-- .../std => examples}/tests/module/self-require.error.i | 0 .../tests/module/self-require.error.i.err | 4 ++-- .../std => examples}/tests/statement/eval-sign.error.i | 0 .../tests/statement/eval-sign.error.i.err | 0 .../tests/statement/eval-type-nested.error.i | 0 .../tests/statement/eval-type-nested.error.i.err | 0 .../std => examples}/tests/statement/eval-type.error.i | 0 .../tests/statement/eval-type.error.i.err | 0 .../tests/statement/function-input-type.error.i | 0 .../tests/statement/function-input-type.error.i.err | 0 .../tests/statement/function-redefine.error.i | 0 .../tests/statement/function-redefine.error.i.err | 0 .../tests/statement/function-return-type.error.i | 0 .../tests/statement/function-return-type.error.i.err | 0 .../tests/statement/node-principal-ports-two.error.i | 0 .../statement/node-principal-ports-two.error.i.err | 0 .../tests/statement/node-principal-ports-zero.error.i | 0 .../statement/node-principal-ports-zero.error.i.err | 0 .../tests/statement/rule-before-node.error.i | 0 .../tests/statement/rule-before-node.error.i.err | 0 .../tests/statement/rule-for-non-own-node.error.i | 0 .../tests/statement/rule-for-non-own-node.error.i.err | 6 +++--- .../tests/statement/rule-node-order.error.i | 0 .../tests/statement/rule-node-order.error.i.err | 0 .../std => examples}/tests/statement/rule-sign.error.i | 0 .../tests/statement/rule-sign.error.i.err | 0 .../tests/statement/rule-type-occur-check.error.i | 0 .../tests/statement/rule-type-occur-check.error.i.err | 0 .../std => examples}/tests/statement/rule-type.error.i | 0 .../tests/statement/rule-type.error.i.err | 0 .../tests/statement/type-args-not-type.error.i | 0 .../tests/statement/type-args-not-type.error.i.err | 0 .../tests/statement/type-not-enough-args.error.i | 0 .../tests/statement/type-not-enough-args.error.i.err | 0 .../tests/statement/type-parameters-not-type.error.i | 0 .../statement/type-parameters-not-type.error.i.err | 0 {docs/std => examples}/tests/value/node.i | 0 {docs/std => examples}/tests/value/node.i.out | 0 {docs/std => examples}/tests/value/port-cap.i | 0 {docs/std => examples}/tests/value/port-cap.i.out | 0 {docs/std => examples}/tests/value/symbol.i | 0 {docs/std => examples}/tests/value/symbol.i.out | 0 {docs/std => examples}/tests/value/type-term.i | 0 {docs/std => examples}/tests/value/type-term.i.out | 0 package.json | 8 ++++---- src/command-line/commands/Format.ts | 2 +- src/command-line/commands/Parse.ts | 2 +- src/command-line/commands/Run.ts | 4 ++-- 110 files changed, 39 insertions(+), 39 deletions(-) rename {docs/std => examples}/datatype/Bin.i (100%) rename {docs/std => examples}/datatype/Bin.test.i (100%) rename {docs/std => examples}/datatype/Bin.test.i.out (100%) rename {docs/std => examples}/datatype/DiffList.i (100%) rename {docs/std => examples}/datatype/DiffList.test.i (100%) rename {docs/std => examples}/datatype/DiffList.test.i.out (100%) rename {docs/std => examples}/datatype/List.i (100%) rename {docs/std => examples}/datatype/List.test.i (100%) rename {docs/std => examples}/datatype/List.test.i.out (100%) rename {docs/std => examples}/datatype/Nat.i (100%) rename {docs/std => examples}/datatype/Nat.test.i (100%) rename {docs/std => examples}/datatype/Nat.test.i.out (100%) rename {docs/std => examples}/datatype/Pair.i (100%) rename {docs/std => examples}/datatype/Pair.i.out (100%) rename {docs/std => examples}/datatype/Trivial.i (100%) rename {docs/std => examples}/tests/builtin/connect-args.error.i (100%) rename {docs/std => examples}/tests/builtin/connect-args.error.i.err (100%) rename {docs/std => examples}/tests/builtin/connect-type.error.i (100%) rename {docs/std => examples}/tests/builtin/connect-type.error.i.err (100%) rename {docs/std => examples}/tests/builtin/inspect-args.error.i (100%) rename {docs/std => examples}/tests/builtin/inspect-args.error.i.err (100%) rename {docs/std => examples}/tests/currying/function-extra-one-arg.i (100%) rename {docs/std => examples}/tests/currying/function-extra-one-arg.i.out (100%) rename {docs/std => examples}/tests/currying/function-not-enough-args.i (100%) rename {docs/std => examples}/tests/currying/function-not-enough-args.i.out (100%) rename {docs/std => examples}/tests/currying/node-extra-one-arg.i (100%) rename {docs/std => examples}/tests/currying/node-extra-one-arg.i.out (100%) rename {docs/std => examples}/tests/currying/node-not-enough-args.i (100%) rename {docs/std => examples}/tests/currying/node-not-enough-args.i.out (100%) rename {docs/std => examples}/tests/linearity/function-variable-double-use.error.i (100%) rename {docs/std => examples}/tests/linearity/function-variable-double-use.error.i.err (100%) rename {docs/std => examples}/tests/linearity/function-variable-not-used.error.i (100%) rename {docs/std => examples}/tests/linearity/function-variable-not-used.error.i.err (100%) rename {docs/std => examples}/tests/linearity/rule-variable-not-used.error.i (100%) rename {docs/std => examples}/tests/linearity/rule-variable-not-used.error.i.err (100%) rename {docs/std => examples}/tests/module/circular-import-1.error.i (100%) rename {docs/std => examples}/tests/module/circular-import-1.error.i.err (75%) rename {docs/std => examples}/tests/module/circular-import-2.error.i (100%) rename {docs/std => examples}/tests/module/circular-import-2.error.i.err (75%) rename {docs/std => examples}/tests/module/circular-import-3.error.i (100%) rename {docs/std => examples}/tests/module/circular-import-3.error.i.err (75%) rename {docs/std => examples}/tests/module/circular-require-1.error.i (100%) rename {docs/std => examples}/tests/module/circular-require-1.error.i.err (73%) rename {docs/std => examples}/tests/module/circular-require-2.error.i (100%) rename {docs/std => examples}/tests/module/circular-require-2.error.i.err (73%) rename {docs/std => examples}/tests/module/circular-require-3.error.i (100%) rename {docs/std => examples}/tests/module/circular-require-3.error.i.err (73%) rename {docs/std => examples}/tests/module/import.i (100%) rename {docs/std => examples}/tests/module/import.i.out (100%) rename {docs/std => examples}/tests/module/require-already-defined.error.i (100%) rename {docs/std => examples}/tests/module/require-already-defined.error.i.err (100%) rename {docs/std => examples}/tests/module/require.i (100%) rename {docs/std => examples}/tests/module/require.i.out (100%) rename {docs/std => examples}/tests/module/reuqire-more-rules-1.i (100%) rename {docs/std => examples}/tests/module/reuqire-more-rules-2.i (100%) rename {docs/std => examples}/tests/module/reuqire-more-rules-3.i (100%) rename {docs/std => examples}/tests/module/reuqire-more-rules-3.i.out (100%) rename {docs/std => examples}/tests/module/self-import.error.i (100%) rename {docs/std => examples}/tests/module/self-import.error.i.err (57%) rename {docs/std => examples}/tests/module/self-require.error.i (100%) rename {docs/std => examples}/tests/module/self-require.error.i.err (56%) rename {docs/std => examples}/tests/statement/eval-sign.error.i (100%) rename {docs/std => examples}/tests/statement/eval-sign.error.i.err (100%) rename {docs/std => examples}/tests/statement/eval-type-nested.error.i (100%) rename {docs/std => examples}/tests/statement/eval-type-nested.error.i.err (100%) rename {docs/std => examples}/tests/statement/eval-type.error.i (100%) rename {docs/std => examples}/tests/statement/eval-type.error.i.err (100%) rename {docs/std => examples}/tests/statement/function-input-type.error.i (100%) rename {docs/std => examples}/tests/statement/function-input-type.error.i.err (100%) rename {docs/std => examples}/tests/statement/function-redefine.error.i (100%) rename {docs/std => examples}/tests/statement/function-redefine.error.i.err (100%) rename {docs/std => examples}/tests/statement/function-return-type.error.i (100%) rename {docs/std => examples}/tests/statement/function-return-type.error.i.err (100%) rename {docs/std => examples}/tests/statement/node-principal-ports-two.error.i (100%) rename {docs/std => examples}/tests/statement/node-principal-ports-two.error.i.err (100%) rename {docs/std => examples}/tests/statement/node-principal-ports-zero.error.i (100%) rename {docs/std => examples}/tests/statement/node-principal-ports-zero.error.i.err (100%) rename {docs/std => examples}/tests/statement/rule-before-node.error.i (100%) rename {docs/std => examples}/tests/statement/rule-before-node.error.i.err (100%) rename {docs/std => examples}/tests/statement/rule-for-non-own-node.error.i (100%) rename {docs/std => examples}/tests/statement/rule-for-non-own-node.error.i.err (69%) rename {docs/std => examples}/tests/statement/rule-node-order.error.i (100%) rename {docs/std => examples}/tests/statement/rule-node-order.error.i.err (100%) rename {docs/std => examples}/tests/statement/rule-sign.error.i (100%) rename {docs/std => examples}/tests/statement/rule-sign.error.i.err (100%) rename {docs/std => examples}/tests/statement/rule-type-occur-check.error.i (100%) rename {docs/std => examples}/tests/statement/rule-type-occur-check.error.i.err (100%) rename {docs/std => examples}/tests/statement/rule-type.error.i (100%) rename {docs/std => examples}/tests/statement/rule-type.error.i.err (100%) rename {docs/std => examples}/tests/statement/type-args-not-type.error.i (100%) rename {docs/std => examples}/tests/statement/type-args-not-type.error.i.err (100%) rename {docs/std => examples}/tests/statement/type-not-enough-args.error.i (100%) rename {docs/std => examples}/tests/statement/type-not-enough-args.error.i.err (100%) rename {docs/std => examples}/tests/statement/type-parameters-not-type.error.i (100%) rename {docs/std => examples}/tests/statement/type-parameters-not-type.error.i.err (100%) rename {docs/std => examples}/tests/value/node.i (100%) rename {docs/std => examples}/tests/value/node.i.out (100%) rename {docs/std => examples}/tests/value/port-cap.i (100%) rename {docs/std => examples}/tests/value/port-cap.i.out (100%) rename {docs/std => examples}/tests/value/symbol.i (100%) rename {docs/std => examples}/tests/value/symbol.i.out (100%) rename {docs/std => examples}/tests/value/type-term.i (100%) rename {docs/std => examples}/tests/value/type-term.i.out (100%) diff --git a/README.md b/README.md index 68e550aa..76b2ef79 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ eval @inspect(sixSoles()) [ [Goto The Playground](https://inet.xieyuheng.com/playground/aW1wb3J0IHsgTGlzdCB9IGZyb20gImh0dHBzOi8vY29kZS1vZi1pbmV0LWpzLnhpZXl1aGVuZy5jb20vZG9jcy9zdGQvZGF0YXR5cGUvTGlzdC5pIgoKLy8gQ29uY2F0ZW5hdGlvbiBvZiBsaXN0cyBpcyBwZXJmb3JtZWQgaW4gbGluZWFyIHRpbWUKLy8gd2l0aCByZXNwZWN0IHRvIGl0cyBmaXJzdCBhcmd1bWVudC4KLy8gQ29uc3RhbnQgdGltZSBjb25jYXRlbmF0aW9uIGlzIHBvc3NpYmxlCi8vIHdpdGggZGlmZmVyZW5jZS1saXN0czogdGhlIGlkZWEgY29uc2lzdHMgaW4KLy8gcGx1Z2dpbmcgdGhlIGZyb250IG9mIHRoZSBzZWNvbmQgYXJndW1lbnQKLy8gYXQgdGhlIGJhY2sgb2YgdGhlIGZpcnN0IG9uZS4KCnR5cGUgRGlmZkxpc3QoRWxlbWVudDogQFR5cGUpCgpub2RlIGRpZmYoCiAgZnJvbnQ6IExpc3QoJ0EpLAogIC0tLS0tLS0KICBiYWNrOiBMaXN0KCdBKSwKICB2YWx1ZSE6IERpZmZMaXN0KCdBKSwKKQoKbm9kZSBkaWZmQXBwZW5kKAogIHRhcmdldCE6IERpZmZMaXN0KCdBKSwKICByZXN0OiBEaWZmTGlzdCgnQSkKICAtLS0tLS0tLQogIHJlc3VsdDogRGlmZkxpc3QoJ0EpCikKCm5vZGUgZGlmZk9wZW4oCiAgdGFyZ2V0ITogRGlmZkxpc3QoJ0EpLAogIG5ld0JhY2s6IExpc3QoJ0EpCiAgLS0tLS0tLS0tLQogIG9sZEJhY2s6IExpc3QoJ0EpCikKCnJ1bGUgZGlmZkFwcGVuZCh0YXJnZXQhLCByZXN0LCByZXN1bHQpCiAgICAgZGlmZihmcm9udCwgYmFjaywgdmFsdWUhKSB7CiAgbGV0IG5ld0JhY2ssIHZhbHVlID0gZGlmZihmcm9udCkKICBAY29ubmVjdCh2YWx1ZSwgcmVzdWx0KQogIGRpZmZPcGVuKHJlc3QsIG5ld0JhY2ssIGJhY2spCn0KCnJ1bGUgZGlmZk9wZW4odGFyZ2V0ISwgbmV3QmFjaywgb2xkQmFjaykKICAgICBkaWZmKGZyb250LCBiYWNrLCB2YWx1ZSEpIHsKICBAY29ubmVjdChiYWNrLCBuZXdCYWNrKQogIEBjb25uZWN0KGZyb250LCBvbGRCYWNrKQp9CgovLyBURVNUCgppbXBvcnQgeyBjb25zIH0gZnJvbSAiaHR0cHM6Ly9jb2RlLW9mLWluZXQtanMueGlleXVoZW5nLmNvbS9kb2NzL3N0ZC9kYXRhdHlwZS9MaXN0LmkiCgp0eXBlIFRyaXZpYWwKCm5vZGUgc29sZSgtLSB2YWx1ZSE6IFRyaXZpYWwpCgpmdW5jdGlvbiB0d29Ud29Tb2xlcygpOiBEaWZmTGlzdChUcml2aWFsKSB7CiAgbGV0IGZyb250LCBiYWNrLCB2YWx1ZTEgPSBkaWZmKCkKICBAY29ubmVjdChmcm9udCwgY29ucyhzb2xlKCksIGNvbnMoc29sZSgpLCBiYWNrKSkpCiAgbGV0IGZyb250LCBiYWNrLCB2YWx1ZTIgPSBkaWZmKCkKICBAY29ubmVjdChmcm9udCwgY29ucyhzb2xlKCksIGNvbnMoc29sZSgpLCBiYWNrKSkpCiAgcmV0dXJuIGRpZmZBcHBlbmQodmFsdWUxLCB2YWx1ZTIpCn0KCmV2YWwgQGluc3BlY3QoQHJ1bih0d29Ud29Tb2xlcygpKSkKZXZhbCBAaW5zcGVjdCh0d29Ud29Tb2xlcygpKQ) ] ```inet -import { List } from "https://code-of-inet-js.xieyuheng.com/docs/std/datatype/List.i" +import { List } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" // Concatenation of lists is performed in linear time // with respect to its first argument. @@ -185,7 +185,7 @@ rule diffOpen(target!, newBack, oldBack) // TEST -import { cons } from "https://code-of-inet-js.xieyuheng.com/docs/std/datatype/List.i" +import { cons } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" type Trivial diff --git a/docs/articles/programming-with-interaction-nets.md b/docs/articles/programming-with-interaction-nets.md index 25f5395f..17150c2e 100644 --- a/docs/articles/programming-with-interaction-nets.md +++ b/docs/articles/programming-with-interaction-nets.md @@ -683,7 +683,7 @@ to import definitions from other module. import { Nat, zero, add1, add, one, two, three, -} from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" +} from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" node natErase( target!: Nat @@ -794,7 +794,7 @@ rule append(target!, rest, result) cons(head, tail, value!) { cons(head, append(tail, rest), result) } -import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" +import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" function sixZeros(): List(Nat) { return append( @@ -836,7 +836,7 @@ the relationship between all nodes is symmetric. [Goto the playground of `DiffList` and `(diffAppend)`](https://inet.xieyuheng.com/playground/aW1wb3J0IHsgTGlzdCB9IGZyb20gImh0dHBzOi8vY29kZS1vZi1pbmV0LWpzLmZpZGIuYXBwL3N0ZC9kYXRhdHlwZS9MaXN0LmkiCgp0eXBlIERpZmZMaXN0KEVsZW1lbnQ6IEBUeXBlKQoKbm9kZSBkaWZmKAogIGZyb250OiBMaXN0KCdBKSwKICAtLS0tLS0tCiAgYmFjazogTGlzdCgnQSksCiAgdmFsdWUhOiBEaWZmTGlzdCgnQSksCikKCm5vZGUgZGlmZkFwcGVuZCgKICB0YXJnZXQhOiBEaWZmTGlzdCgnQSksCiAgcmVzdDogRGlmZkxpc3QoJ0EpCiAgLS0tLS0tLS0KICByZXN1bHQ6IERpZmZMaXN0KCdBKQopCgpub2RlIGRpZmZPcGVuKAogIHRhcmdldCE6IERpZmZMaXN0KCdBKSwKICBuZXdCYWNrOiBMaXN0KCdBKQogIC0tLS0tLS0tLS0KICBvbGRCYWNrOiBMaXN0KCdBKQopCgpydWxlIGRpZmZBcHBlbmQodGFyZ2V0ISwgcmVzdCwgcmVzdWx0KQogICAgIGRpZmYoZnJvbnQsIGJhY2ssIHZhbHVlISkgewogIGxldCBuZXdCYWNrLCB2YWx1ZSA9IGRpZmYoZnJvbnQpCiAgQGNvbm5lY3QodmFsdWUsIHJlc3VsdCkKICBkaWZmT3BlbihyZXN0LCBuZXdCYWNrLCBiYWNrKQp9CgpydWxlIGRpZmZPcGVuKHRhcmdldCEsIG5ld0JhY2ssIG9sZEJhY2spCiAgICAgZGlmZihmcm9udCwgYmFjaywgdmFsdWUhKSB7CiAgQGNvbm5lY3QoYmFjaywgbmV3QmFjaykKICBAY29ubmVjdChmcm9udCwgb2xkQmFjaykKfQoKaW1wb3J0IHsgTmF0LCB6ZXJvIH0gZnJvbSAiaHR0cHM6Ly9jb2RlLW9mLWluZXQtanMuZmlkYi5hcHAvc3RkL2RhdGF0eXBlL05hdC5pIgppbXBvcnQgeyBjb25zIH0gZnJvbSAiaHR0cHM6Ly9jb2RlLW9mLWluZXQtanMuZmlkYi5hcHAvc3RkL2RhdGF0eXBlL0xpc3QuaSIKCmZ1bmN0aW9uIHR3b1R3b1plcm9zKCk6IERpZmZMaXN0KE5hdCkgewogIGxldCBmcm9udCwgYmFjaywgdmFsdWUxID0gZGlmZigpCiAgQGNvbm5lY3QoZnJvbnQsIGNvbnMoemVybygpLCBjb25zKHplcm8oKSwgYmFjaykpKQogIGxldCBmcm9udCwgYmFjaywgdmFsdWUyID0gZGlmZigpCiAgQGNvbm5lY3QoZnJvbnQsIGNvbnMoemVybygpLCBjb25zKHplcm8oKSwgYmFjaykpKQogIHJldHVybiBkaWZmQXBwZW5kKHZhbHVlMSwgdmFsdWUyKQp9CgpldmFsIHR3b1R3b1plcm9zKCk) ``` -import { List } from "https://code-of-inet-js.xieyuheng.com/std/datatype/List.i" +import { List } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" type DiffList(Element: @Type) @@ -874,8 +874,8 @@ rule diffOpen(target!, newBack, oldBack) @connect(front, oldBack) } -import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" -import { cons } from "https://code-of-inet-js.xieyuheng.com/std/datatype/List.i" +import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" +import { cons } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" function twoTwoZeros(): DiffList(Nat) { let front, back, value1 = diff() diff --git "a/docs/articles/\345\217\215\345\272\224\347\275\221\347\274\226\347\250\213.md" "b/docs/articles/\345\217\215\345\272\224\347\275\221\347\274\226\347\250\213.md" index 200db4fd..fb7ea75d 100644 --- "a/docs/articles/\345\217\215\345\272\224\347\275\221\347\274\226\347\250\213.md" +++ "b/docs/articles/\345\217\215\345\272\224\347\275\221\347\274\226\347\250\213.md" @@ -659,7 +659,7 @@ eval max(two(), three()) import { Nat, zero, add1, add, one, two, three, -} from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" +} from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" node natErase( target!: Nat @@ -768,7 +768,7 @@ rule append(target!, rest, result) cons(head, tail, value!) { cons(head, append(tail, rest), result) } -import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" +import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" function sixZeros(): List(Nat) { return append( @@ -806,7 +806,7 @@ eval sixZeros() [去 `DiffList` 与 `(diffAppend)` 的演算场](https://inet.xieyuheng.com/playground/aW1wb3J0IHsgTGlzdCB9IGZyb20gImh0dHBzOi8vY29kZS1vZi1pbmV0LWpzLmZpZGIuYXBwL3N0ZC9kYXRhdHlwZS9MaXN0LmkiCgp0eXBlIERpZmZMaXN0KEVsZW1lbnQ6IEBUeXBlKQoKbm9kZSBkaWZmKAogIGZyb250OiBMaXN0KCdBKSwKICAtLS0tLS0tCiAgYmFjazogTGlzdCgnQSksCiAgdmFsdWUhOiBEaWZmTGlzdCgnQSksCikKCm5vZGUgZGlmZkFwcGVuZCgKICB0YXJnZXQhOiBEaWZmTGlzdCgnQSksCiAgcmVzdDogRGlmZkxpc3QoJ0EpCiAgLS0tLS0tLS0KICByZXN1bHQ6IERpZmZMaXN0KCdBKQopCgpub2RlIGRpZmZPcGVuKAogIHRhcmdldCE6IERpZmZMaXN0KCdBKSwKICBuZXdCYWNrOiBMaXN0KCdBKQogIC0tLS0tLS0tLS0KICBvbGRCYWNrOiBMaXN0KCdBKQopCgpydWxlIGRpZmZBcHBlbmQodGFyZ2V0ISwgcmVzdCwgcmVzdWx0KQogICAgIGRpZmYoZnJvbnQsIGJhY2ssIHZhbHVlISkgewogIGxldCBuZXdCYWNrLCB2YWx1ZSA9IGRpZmYoZnJvbnQpCiAgQGNvbm5lY3QodmFsdWUsIHJlc3VsdCkKICBkaWZmT3BlbihyZXN0LCBuZXdCYWNrLCBiYWNrKQp9CgpydWxlIGRpZmZPcGVuKHRhcmdldCEsIG5ld0JhY2ssIG9sZEJhY2spCiAgICAgZGlmZihmcm9udCwgYmFjaywgdmFsdWUhKSB7CiAgQGNvbm5lY3QoYmFjaywgbmV3QmFjaykKICBAY29ubmVjdChmcm9udCwgb2xkQmFjaykKfQoKaW1wb3J0IHsgTmF0LCB6ZXJvIH0gZnJvbSAiaHR0cHM6Ly9jb2RlLW9mLWluZXQtanMuZmlkYi5hcHAvc3RkL2RhdGF0eXBlL05hdC5pIgppbXBvcnQgeyBjb25zIH0gZnJvbSAiaHR0cHM6Ly9jb2RlLW9mLWluZXQtanMuZmlkYi5hcHAvc3RkL2RhdGF0eXBlL0xpc3QuaSIKCmZ1bmN0aW9uIHR3b1R3b1plcm9zKCk6IERpZmZMaXN0KE5hdCkgewogIGxldCBmcm9udCwgYmFjaywgdmFsdWUxID0gZGlmZigpCiAgQGNvbm5lY3QoZnJvbnQsIGNvbnMoemVybygpLCBjb25zKHplcm8oKSwgYmFjaykpKQogIGxldCBmcm9udCwgYmFjaywgdmFsdWUyID0gZGlmZigpCiAgQGNvbm5lY3QoZnJvbnQsIGNvbnMoemVybygpLCBjb25zKHplcm8oKSwgYmFjaykpKQogIHJldHVybiBkaWZmQXBwZW5kKHZhbHVlMSwgdmFsdWUyKQp9CgpldmFsIHR3b1R3b1plcm9zKCk) ``` -import { List } from "https://code-of-inet-js.xieyuheng.com/std/datatype/List.i" +import { List } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" type DiffList(Element: @Type) @@ -844,8 +844,8 @@ rule diffOpen(target!, newBack, oldBack) @connect(front, oldBack) } -import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/std/datatype/Nat.i" -import { cons } from "https://code-of-inet-js.xieyuheng.com/std/datatype/List.i" +import { Nat, zero } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/Nat.i" +import { cons } from "https://code-of-inet-js.xieyuheng.com/examples/datatype/List.i" function twoTwoZeros(): DiffList(Nat) { let front, back, value1 = diff() diff --git a/docs/std/datatype/Bin.i b/examples/datatype/Bin.i similarity index 100% rename from docs/std/datatype/Bin.i rename to examples/datatype/Bin.i diff --git a/docs/std/datatype/Bin.test.i b/examples/datatype/Bin.test.i similarity index 100% rename from docs/std/datatype/Bin.test.i rename to examples/datatype/Bin.test.i diff --git a/docs/std/datatype/Bin.test.i.out b/examples/datatype/Bin.test.i.out similarity index 100% rename from docs/std/datatype/Bin.test.i.out rename to examples/datatype/Bin.test.i.out diff --git a/docs/std/datatype/DiffList.i b/examples/datatype/DiffList.i similarity index 100% rename from docs/std/datatype/DiffList.i rename to examples/datatype/DiffList.i diff --git a/docs/std/datatype/DiffList.test.i b/examples/datatype/DiffList.test.i similarity index 100% rename from docs/std/datatype/DiffList.test.i rename to examples/datatype/DiffList.test.i diff --git a/docs/std/datatype/DiffList.test.i.out b/examples/datatype/DiffList.test.i.out similarity index 100% rename from docs/std/datatype/DiffList.test.i.out rename to examples/datatype/DiffList.test.i.out diff --git a/docs/std/datatype/List.i b/examples/datatype/List.i similarity index 100% rename from docs/std/datatype/List.i rename to examples/datatype/List.i diff --git a/docs/std/datatype/List.test.i b/examples/datatype/List.test.i similarity index 100% rename from docs/std/datatype/List.test.i rename to examples/datatype/List.test.i diff --git a/docs/std/datatype/List.test.i.out b/examples/datatype/List.test.i.out similarity index 100% rename from docs/std/datatype/List.test.i.out rename to examples/datatype/List.test.i.out diff --git a/docs/std/datatype/Nat.i b/examples/datatype/Nat.i similarity index 100% rename from docs/std/datatype/Nat.i rename to examples/datatype/Nat.i diff --git a/docs/std/datatype/Nat.test.i b/examples/datatype/Nat.test.i similarity index 100% rename from docs/std/datatype/Nat.test.i rename to examples/datatype/Nat.test.i diff --git a/docs/std/datatype/Nat.test.i.out b/examples/datatype/Nat.test.i.out similarity index 100% rename from docs/std/datatype/Nat.test.i.out rename to examples/datatype/Nat.test.i.out diff --git a/docs/std/datatype/Pair.i b/examples/datatype/Pair.i similarity index 100% rename from docs/std/datatype/Pair.i rename to examples/datatype/Pair.i diff --git a/docs/std/datatype/Pair.i.out b/examples/datatype/Pair.i.out similarity index 100% rename from docs/std/datatype/Pair.i.out rename to examples/datatype/Pair.i.out diff --git a/docs/std/datatype/Trivial.i b/examples/datatype/Trivial.i similarity index 100% rename from docs/std/datatype/Trivial.i rename to examples/datatype/Trivial.i diff --git a/docs/std/tests/builtin/connect-args.error.i b/examples/tests/builtin/connect-args.error.i similarity index 100% rename from docs/std/tests/builtin/connect-args.error.i rename to examples/tests/builtin/connect-args.error.i diff --git a/docs/std/tests/builtin/connect-args.error.i.err b/examples/tests/builtin/connect-args.error.i.err similarity index 100% rename from docs/std/tests/builtin/connect-args.error.i.err rename to examples/tests/builtin/connect-args.error.i.err diff --git a/docs/std/tests/builtin/connect-type.error.i b/examples/tests/builtin/connect-type.error.i similarity index 100% rename from docs/std/tests/builtin/connect-type.error.i rename to examples/tests/builtin/connect-type.error.i diff --git a/docs/std/tests/builtin/connect-type.error.i.err b/examples/tests/builtin/connect-type.error.i.err similarity index 100% rename from docs/std/tests/builtin/connect-type.error.i.err rename to examples/tests/builtin/connect-type.error.i.err diff --git a/docs/std/tests/builtin/inspect-args.error.i b/examples/tests/builtin/inspect-args.error.i similarity index 100% rename from docs/std/tests/builtin/inspect-args.error.i rename to examples/tests/builtin/inspect-args.error.i diff --git a/docs/std/tests/builtin/inspect-args.error.i.err b/examples/tests/builtin/inspect-args.error.i.err similarity index 100% rename from docs/std/tests/builtin/inspect-args.error.i.err rename to examples/tests/builtin/inspect-args.error.i.err diff --git a/docs/std/tests/currying/function-extra-one-arg.i b/examples/tests/currying/function-extra-one-arg.i similarity index 100% rename from docs/std/tests/currying/function-extra-one-arg.i rename to examples/tests/currying/function-extra-one-arg.i diff --git a/docs/std/tests/currying/function-extra-one-arg.i.out b/examples/tests/currying/function-extra-one-arg.i.out similarity index 100% rename from docs/std/tests/currying/function-extra-one-arg.i.out rename to examples/tests/currying/function-extra-one-arg.i.out diff --git a/docs/std/tests/currying/function-not-enough-args.i b/examples/tests/currying/function-not-enough-args.i similarity index 100% rename from docs/std/tests/currying/function-not-enough-args.i rename to examples/tests/currying/function-not-enough-args.i diff --git a/docs/std/tests/currying/function-not-enough-args.i.out b/examples/tests/currying/function-not-enough-args.i.out similarity index 100% rename from docs/std/tests/currying/function-not-enough-args.i.out rename to examples/tests/currying/function-not-enough-args.i.out diff --git a/docs/std/tests/currying/node-extra-one-arg.i b/examples/tests/currying/node-extra-one-arg.i similarity index 100% rename from docs/std/tests/currying/node-extra-one-arg.i rename to examples/tests/currying/node-extra-one-arg.i diff --git a/docs/std/tests/currying/node-extra-one-arg.i.out b/examples/tests/currying/node-extra-one-arg.i.out similarity index 100% rename from docs/std/tests/currying/node-extra-one-arg.i.out rename to examples/tests/currying/node-extra-one-arg.i.out diff --git a/docs/std/tests/currying/node-not-enough-args.i b/examples/tests/currying/node-not-enough-args.i similarity index 100% rename from docs/std/tests/currying/node-not-enough-args.i rename to examples/tests/currying/node-not-enough-args.i diff --git a/docs/std/tests/currying/node-not-enough-args.i.out b/examples/tests/currying/node-not-enough-args.i.out similarity index 100% rename from docs/std/tests/currying/node-not-enough-args.i.out rename to examples/tests/currying/node-not-enough-args.i.out diff --git a/docs/std/tests/linearity/function-variable-double-use.error.i b/examples/tests/linearity/function-variable-double-use.error.i similarity index 100% rename from docs/std/tests/linearity/function-variable-double-use.error.i rename to examples/tests/linearity/function-variable-double-use.error.i diff --git a/docs/std/tests/linearity/function-variable-double-use.error.i.err b/examples/tests/linearity/function-variable-double-use.error.i.err similarity index 100% rename from docs/std/tests/linearity/function-variable-double-use.error.i.err rename to examples/tests/linearity/function-variable-double-use.error.i.err diff --git a/docs/std/tests/linearity/function-variable-not-used.error.i b/examples/tests/linearity/function-variable-not-used.error.i similarity index 100% rename from docs/std/tests/linearity/function-variable-not-used.error.i rename to examples/tests/linearity/function-variable-not-used.error.i diff --git a/docs/std/tests/linearity/function-variable-not-used.error.i.err b/examples/tests/linearity/function-variable-not-used.error.i.err similarity index 100% rename from docs/std/tests/linearity/function-variable-not-used.error.i.err rename to examples/tests/linearity/function-variable-not-used.error.i.err diff --git a/docs/std/tests/linearity/rule-variable-not-used.error.i b/examples/tests/linearity/rule-variable-not-used.error.i similarity index 100% rename from docs/std/tests/linearity/rule-variable-not-used.error.i rename to examples/tests/linearity/rule-variable-not-used.error.i diff --git a/docs/std/tests/linearity/rule-variable-not-used.error.i.err b/examples/tests/linearity/rule-variable-not-used.error.i.err similarity index 100% rename from docs/std/tests/linearity/rule-variable-not-used.error.i.err rename to examples/tests/linearity/rule-variable-not-used.error.i.err diff --git a/docs/std/tests/module/circular-import-1.error.i b/examples/tests/module/circular-import-1.error.i similarity index 100% rename from docs/std/tests/module/circular-import-1.error.i rename to examples/tests/module/circular-import-1.error.i diff --git a/docs/std/tests/module/circular-import-1.error.i.err b/examples/tests/module/circular-import-1.error.i.err similarity index 75% rename from docs/std/tests/module/circular-import-1.error.i.err rename to examples/tests/module/circular-import-1.error.i.err index 3721beb2..2252e52d 100644 --- a/docs/std/tests/module/circular-import-1.error.i.err +++ b/examples/tests/module/circular-import-1.error.i.err @@ -1,7 +1,7 @@ [execute / Import] I can not do circular import. - loading module url: docs/std/tests/module/circular-import-3.error.i - importing module url: docs/std/tests/module/circular-import-1.error.i + loading module url: examples/tests/module/circular-import-3.error.i + importing module url: examples/tests/module/circular-import-1.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/circular-import-2.error.i b/examples/tests/module/circular-import-2.error.i similarity index 100% rename from docs/std/tests/module/circular-import-2.error.i rename to examples/tests/module/circular-import-2.error.i diff --git a/docs/std/tests/module/circular-import-2.error.i.err b/examples/tests/module/circular-import-2.error.i.err similarity index 75% rename from docs/std/tests/module/circular-import-2.error.i.err rename to examples/tests/module/circular-import-2.error.i.err index 199638e1..5997f555 100644 --- a/docs/std/tests/module/circular-import-2.error.i.err +++ b/examples/tests/module/circular-import-2.error.i.err @@ -1,7 +1,7 @@ [execute / Import] I can not do circular import. - loading module url: docs/std/tests/module/circular-import-1.error.i - importing module url: docs/std/tests/module/circular-import-2.error.i + loading module url: examples/tests/module/circular-import-1.error.i + importing module url: examples/tests/module/circular-import-2.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/circular-import-3.error.i b/examples/tests/module/circular-import-3.error.i similarity index 100% rename from docs/std/tests/module/circular-import-3.error.i rename to examples/tests/module/circular-import-3.error.i diff --git a/docs/std/tests/module/circular-import-3.error.i.err b/examples/tests/module/circular-import-3.error.i.err similarity index 75% rename from docs/std/tests/module/circular-import-3.error.i.err rename to examples/tests/module/circular-import-3.error.i.err index d50a94e2..513b25b5 100644 --- a/docs/std/tests/module/circular-import-3.error.i.err +++ b/examples/tests/module/circular-import-3.error.i.err @@ -1,7 +1,7 @@ [execute / Import] I can not do circular import. - loading module url: docs/std/tests/module/circular-import-2.error.i - importing module url: docs/std/tests/module/circular-import-3.error.i + loading module url: examples/tests/module/circular-import-2.error.i + importing module url: examples/tests/module/circular-import-3.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/circular-require-1.error.i b/examples/tests/module/circular-require-1.error.i similarity index 100% rename from docs/std/tests/module/circular-require-1.error.i rename to examples/tests/module/circular-require-1.error.i diff --git a/docs/std/tests/module/circular-require-1.error.i.err b/examples/tests/module/circular-require-1.error.i.err similarity index 73% rename from docs/std/tests/module/circular-require-1.error.i.err rename to examples/tests/module/circular-require-1.error.i.err index 3aacdb78..19dada39 100644 --- a/docs/std/tests/module/circular-require-1.error.i.err +++ b/examples/tests/module/circular-require-1.error.i.err @@ -1,7 +1,7 @@ [execute / Require] I can not do circular require. - loading module url: docs/std/tests/module/circular-require-3.error.i - requiring module url: docs/std/tests/module/circular-require-1.error.i + loading module url: examples/tests/module/circular-require-3.error.i + requiring module url: examples/tests/module/circular-require-1.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/circular-require-2.error.i b/examples/tests/module/circular-require-2.error.i similarity index 100% rename from docs/std/tests/module/circular-require-2.error.i rename to examples/tests/module/circular-require-2.error.i diff --git a/docs/std/tests/module/circular-require-2.error.i.err b/examples/tests/module/circular-require-2.error.i.err similarity index 73% rename from docs/std/tests/module/circular-require-2.error.i.err rename to examples/tests/module/circular-require-2.error.i.err index cac1eb5d..8ec112d5 100644 --- a/docs/std/tests/module/circular-require-2.error.i.err +++ b/examples/tests/module/circular-require-2.error.i.err @@ -1,7 +1,7 @@ [execute / Require] I can not do circular require. - loading module url: docs/std/tests/module/circular-require-1.error.i - requiring module url: docs/std/tests/module/circular-require-2.error.i + loading module url: examples/tests/module/circular-require-1.error.i + requiring module url: examples/tests/module/circular-require-2.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/circular-require-3.error.i b/examples/tests/module/circular-require-3.error.i similarity index 100% rename from docs/std/tests/module/circular-require-3.error.i rename to examples/tests/module/circular-require-3.error.i diff --git a/docs/std/tests/module/circular-require-3.error.i.err b/examples/tests/module/circular-require-3.error.i.err similarity index 73% rename from docs/std/tests/module/circular-require-3.error.i.err rename to examples/tests/module/circular-require-3.error.i.err index 0c117773..6255ff1a 100644 --- a/docs/std/tests/module/circular-require-3.error.i.err +++ b/examples/tests/module/circular-require-3.error.i.err @@ -1,7 +1,7 @@ [execute / Require] I can not do circular require. - loading module url: docs/std/tests/module/circular-require-2.error.i - requiring module url: docs/std/tests/module/circular-require-3.error.i + loading module url: examples/tests/module/circular-require-2.error.i + requiring module url: examples/tests/module/circular-require-3.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/import.i b/examples/tests/module/import.i similarity index 100% rename from docs/std/tests/module/import.i rename to examples/tests/module/import.i diff --git a/docs/std/tests/module/import.i.out b/examples/tests/module/import.i.out similarity index 100% rename from docs/std/tests/module/import.i.out rename to examples/tests/module/import.i.out diff --git a/docs/std/tests/module/require-already-defined.error.i b/examples/tests/module/require-already-defined.error.i similarity index 100% rename from docs/std/tests/module/require-already-defined.error.i rename to examples/tests/module/require-already-defined.error.i diff --git a/docs/std/tests/module/require-already-defined.error.i.err b/examples/tests/module/require-already-defined.error.i.err similarity index 100% rename from docs/std/tests/module/require-already-defined.error.i.err rename to examples/tests/module/require-already-defined.error.i.err diff --git a/docs/std/tests/module/require.i b/examples/tests/module/require.i similarity index 100% rename from docs/std/tests/module/require.i rename to examples/tests/module/require.i diff --git a/docs/std/tests/module/require.i.out b/examples/tests/module/require.i.out similarity index 100% rename from docs/std/tests/module/require.i.out rename to examples/tests/module/require.i.out diff --git a/docs/std/tests/module/reuqire-more-rules-1.i b/examples/tests/module/reuqire-more-rules-1.i similarity index 100% rename from docs/std/tests/module/reuqire-more-rules-1.i rename to examples/tests/module/reuqire-more-rules-1.i diff --git a/docs/std/tests/module/reuqire-more-rules-2.i b/examples/tests/module/reuqire-more-rules-2.i similarity index 100% rename from docs/std/tests/module/reuqire-more-rules-2.i rename to examples/tests/module/reuqire-more-rules-2.i diff --git a/docs/std/tests/module/reuqire-more-rules-3.i b/examples/tests/module/reuqire-more-rules-3.i similarity index 100% rename from docs/std/tests/module/reuqire-more-rules-3.i rename to examples/tests/module/reuqire-more-rules-3.i diff --git a/docs/std/tests/module/reuqire-more-rules-3.i.out b/examples/tests/module/reuqire-more-rules-3.i.out similarity index 100% rename from docs/std/tests/module/reuqire-more-rules-3.i.out rename to examples/tests/module/reuqire-more-rules-3.i.out diff --git a/docs/std/tests/module/self-import.error.i b/examples/tests/module/self-import.error.i similarity index 100% rename from docs/std/tests/module/self-import.error.i rename to examples/tests/module/self-import.error.i diff --git a/docs/std/tests/module/self-import.error.i.err b/examples/tests/module/self-import.error.i.err similarity index 57% rename from docs/std/tests/module/self-import.error.i.err rename to examples/tests/module/self-import.error.i.err index f1580335..0775c3e5 100644 --- a/docs/std/tests/module/self-import.error.i.err +++ b/examples/tests/module/self-import.error.i.err @@ -1,7 +1,7 @@ [execute / Import] I can not do circular import. - loading module url: docs/std/tests/module/self-import.error.i - importing module url: docs/std/tests/module/self-import.error.i + loading module url: examples/tests/module/self-import.error.i + importing module url: examples/tests/module/self-import.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/module/self-require.error.i b/examples/tests/module/self-require.error.i similarity index 100% rename from docs/std/tests/module/self-require.error.i rename to examples/tests/module/self-require.error.i diff --git a/docs/std/tests/module/self-require.error.i.err b/examples/tests/module/self-require.error.i.err similarity index 56% rename from docs/std/tests/module/self-require.error.i.err rename to examples/tests/module/self-require.error.i.err index 3cee8bec..fb4a50b0 100644 --- a/docs/std/tests/module/self-require.error.i.err +++ b/examples/tests/module/self-require.error.i.err @@ -1,7 +1,7 @@ [execute / Require] I can not do circular require. - loading module url: docs/std/tests/module/self-require.error.i - requiring module url: docs/std/tests/module/self-require.error.i + loading module url: examples/tests/module/self-require.error.i + requiring module url: examples/tests/module/self-require.error.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/statement/eval-sign.error.i b/examples/tests/statement/eval-sign.error.i similarity index 100% rename from docs/std/tests/statement/eval-sign.error.i rename to examples/tests/statement/eval-sign.error.i diff --git a/docs/std/tests/statement/eval-sign.error.i.err b/examples/tests/statement/eval-sign.error.i.err similarity index 100% rename from docs/std/tests/statement/eval-sign.error.i.err rename to examples/tests/statement/eval-sign.error.i.err diff --git a/docs/std/tests/statement/eval-type-nested.error.i b/examples/tests/statement/eval-type-nested.error.i similarity index 100% rename from docs/std/tests/statement/eval-type-nested.error.i rename to examples/tests/statement/eval-type-nested.error.i diff --git a/docs/std/tests/statement/eval-type-nested.error.i.err b/examples/tests/statement/eval-type-nested.error.i.err similarity index 100% rename from docs/std/tests/statement/eval-type-nested.error.i.err rename to examples/tests/statement/eval-type-nested.error.i.err diff --git a/docs/std/tests/statement/eval-type.error.i b/examples/tests/statement/eval-type.error.i similarity index 100% rename from docs/std/tests/statement/eval-type.error.i rename to examples/tests/statement/eval-type.error.i diff --git a/docs/std/tests/statement/eval-type.error.i.err b/examples/tests/statement/eval-type.error.i.err similarity index 100% rename from docs/std/tests/statement/eval-type.error.i.err rename to examples/tests/statement/eval-type.error.i.err diff --git a/docs/std/tests/statement/function-input-type.error.i b/examples/tests/statement/function-input-type.error.i similarity index 100% rename from docs/std/tests/statement/function-input-type.error.i rename to examples/tests/statement/function-input-type.error.i diff --git a/docs/std/tests/statement/function-input-type.error.i.err b/examples/tests/statement/function-input-type.error.i.err similarity index 100% rename from docs/std/tests/statement/function-input-type.error.i.err rename to examples/tests/statement/function-input-type.error.i.err diff --git a/docs/std/tests/statement/function-redefine.error.i b/examples/tests/statement/function-redefine.error.i similarity index 100% rename from docs/std/tests/statement/function-redefine.error.i rename to examples/tests/statement/function-redefine.error.i diff --git a/docs/std/tests/statement/function-redefine.error.i.err b/examples/tests/statement/function-redefine.error.i.err similarity index 100% rename from docs/std/tests/statement/function-redefine.error.i.err rename to examples/tests/statement/function-redefine.error.i.err diff --git a/docs/std/tests/statement/function-return-type.error.i b/examples/tests/statement/function-return-type.error.i similarity index 100% rename from docs/std/tests/statement/function-return-type.error.i rename to examples/tests/statement/function-return-type.error.i diff --git a/docs/std/tests/statement/function-return-type.error.i.err b/examples/tests/statement/function-return-type.error.i.err similarity index 100% rename from docs/std/tests/statement/function-return-type.error.i.err rename to examples/tests/statement/function-return-type.error.i.err diff --git a/docs/std/tests/statement/node-principal-ports-two.error.i b/examples/tests/statement/node-principal-ports-two.error.i similarity index 100% rename from docs/std/tests/statement/node-principal-ports-two.error.i rename to examples/tests/statement/node-principal-ports-two.error.i diff --git a/docs/std/tests/statement/node-principal-ports-two.error.i.err b/examples/tests/statement/node-principal-ports-two.error.i.err similarity index 100% rename from docs/std/tests/statement/node-principal-ports-two.error.i.err rename to examples/tests/statement/node-principal-ports-two.error.i.err diff --git a/docs/std/tests/statement/node-principal-ports-zero.error.i b/examples/tests/statement/node-principal-ports-zero.error.i similarity index 100% rename from docs/std/tests/statement/node-principal-ports-zero.error.i rename to examples/tests/statement/node-principal-ports-zero.error.i diff --git a/docs/std/tests/statement/node-principal-ports-zero.error.i.err b/examples/tests/statement/node-principal-ports-zero.error.i.err similarity index 100% rename from docs/std/tests/statement/node-principal-ports-zero.error.i.err rename to examples/tests/statement/node-principal-ports-zero.error.i.err diff --git a/docs/std/tests/statement/rule-before-node.error.i b/examples/tests/statement/rule-before-node.error.i similarity index 100% rename from docs/std/tests/statement/rule-before-node.error.i rename to examples/tests/statement/rule-before-node.error.i diff --git a/docs/std/tests/statement/rule-before-node.error.i.err b/examples/tests/statement/rule-before-node.error.i.err similarity index 100% rename from docs/std/tests/statement/rule-before-node.error.i.err rename to examples/tests/statement/rule-before-node.error.i.err diff --git a/docs/std/tests/statement/rule-for-non-own-node.error.i b/examples/tests/statement/rule-for-non-own-node.error.i similarity index 100% rename from docs/std/tests/statement/rule-for-non-own-node.error.i rename to examples/tests/statement/rule-for-non-own-node.error.i diff --git a/docs/std/tests/statement/rule-for-non-own-node.error.i.err b/examples/tests/statement/rule-for-non-own-node.error.i.err similarity index 69% rename from docs/std/tests/statement/rule-for-non-own-node.error.i.err rename to examples/tests/statement/rule-for-non-own-node.error.i.err index f901ff53..7b155231 100644 --- a/docs/std/tests/statement/rule-for-non-own-node.error.i.err +++ b/examples/tests/statement/rule-for-non-own-node.error.i.err @@ -1,8 +1,8 @@ [checkRuleIsAboutOwnNode] To define a rule, one of the node must be owned by this module. - loading module url: docs/std/tests/statement/rule-for-non-own-node.error.i - first node module url: docs/std/datatype/Nat.i - second node module url: docs/std/datatype/Nat.i + loading module url: examples/tests/statement/rule-for-non-own-node.error.i + first node module url: examples/datatype/Nat.i + second node module url: examples/datatype/Nat.i [execute] I fail to execute a statement. diff --git a/docs/std/tests/statement/rule-node-order.error.i b/examples/tests/statement/rule-node-order.error.i similarity index 100% rename from docs/std/tests/statement/rule-node-order.error.i rename to examples/tests/statement/rule-node-order.error.i diff --git a/docs/std/tests/statement/rule-node-order.error.i.err b/examples/tests/statement/rule-node-order.error.i.err similarity index 100% rename from docs/std/tests/statement/rule-node-order.error.i.err rename to examples/tests/statement/rule-node-order.error.i.err diff --git a/docs/std/tests/statement/rule-sign.error.i b/examples/tests/statement/rule-sign.error.i similarity index 100% rename from docs/std/tests/statement/rule-sign.error.i rename to examples/tests/statement/rule-sign.error.i diff --git a/docs/std/tests/statement/rule-sign.error.i.err b/examples/tests/statement/rule-sign.error.i.err similarity index 100% rename from docs/std/tests/statement/rule-sign.error.i.err rename to examples/tests/statement/rule-sign.error.i.err diff --git a/docs/std/tests/statement/rule-type-occur-check.error.i b/examples/tests/statement/rule-type-occur-check.error.i similarity index 100% rename from docs/std/tests/statement/rule-type-occur-check.error.i rename to examples/tests/statement/rule-type-occur-check.error.i diff --git a/docs/std/tests/statement/rule-type-occur-check.error.i.err b/examples/tests/statement/rule-type-occur-check.error.i.err similarity index 100% rename from docs/std/tests/statement/rule-type-occur-check.error.i.err rename to examples/tests/statement/rule-type-occur-check.error.i.err diff --git a/docs/std/tests/statement/rule-type.error.i b/examples/tests/statement/rule-type.error.i similarity index 100% rename from docs/std/tests/statement/rule-type.error.i rename to examples/tests/statement/rule-type.error.i diff --git a/docs/std/tests/statement/rule-type.error.i.err b/examples/tests/statement/rule-type.error.i.err similarity index 100% rename from docs/std/tests/statement/rule-type.error.i.err rename to examples/tests/statement/rule-type.error.i.err diff --git a/docs/std/tests/statement/type-args-not-type.error.i b/examples/tests/statement/type-args-not-type.error.i similarity index 100% rename from docs/std/tests/statement/type-args-not-type.error.i rename to examples/tests/statement/type-args-not-type.error.i diff --git a/docs/std/tests/statement/type-args-not-type.error.i.err b/examples/tests/statement/type-args-not-type.error.i.err similarity index 100% rename from docs/std/tests/statement/type-args-not-type.error.i.err rename to examples/tests/statement/type-args-not-type.error.i.err diff --git a/docs/std/tests/statement/type-not-enough-args.error.i b/examples/tests/statement/type-not-enough-args.error.i similarity index 100% rename from docs/std/tests/statement/type-not-enough-args.error.i rename to examples/tests/statement/type-not-enough-args.error.i diff --git a/docs/std/tests/statement/type-not-enough-args.error.i.err b/examples/tests/statement/type-not-enough-args.error.i.err similarity index 100% rename from docs/std/tests/statement/type-not-enough-args.error.i.err rename to examples/tests/statement/type-not-enough-args.error.i.err diff --git a/docs/std/tests/statement/type-parameters-not-type.error.i b/examples/tests/statement/type-parameters-not-type.error.i similarity index 100% rename from docs/std/tests/statement/type-parameters-not-type.error.i rename to examples/tests/statement/type-parameters-not-type.error.i diff --git a/docs/std/tests/statement/type-parameters-not-type.error.i.err b/examples/tests/statement/type-parameters-not-type.error.i.err similarity index 100% rename from docs/std/tests/statement/type-parameters-not-type.error.i.err rename to examples/tests/statement/type-parameters-not-type.error.i.err diff --git a/docs/std/tests/value/node.i b/examples/tests/value/node.i similarity index 100% rename from docs/std/tests/value/node.i rename to examples/tests/value/node.i diff --git a/docs/std/tests/value/node.i.out b/examples/tests/value/node.i.out similarity index 100% rename from docs/std/tests/value/node.i.out rename to examples/tests/value/node.i.out diff --git a/docs/std/tests/value/port-cap.i b/examples/tests/value/port-cap.i similarity index 100% rename from docs/std/tests/value/port-cap.i rename to examples/tests/value/port-cap.i diff --git a/docs/std/tests/value/port-cap.i.out b/examples/tests/value/port-cap.i.out similarity index 100% rename from docs/std/tests/value/port-cap.i.out rename to examples/tests/value/port-cap.i.out diff --git a/docs/std/tests/value/symbol.i b/examples/tests/value/symbol.i similarity index 100% rename from docs/std/tests/value/symbol.i rename to examples/tests/value/symbol.i diff --git a/docs/std/tests/value/symbol.i.out b/examples/tests/value/symbol.i.out similarity index 100% rename from docs/std/tests/value/symbol.i.out rename to examples/tests/value/symbol.i.out diff --git a/docs/std/tests/value/type-term.i b/examples/tests/value/type-term.i similarity index 100% rename from docs/std/tests/value/type-term.i rename to examples/tests/value/type-term.i diff --git a/docs/std/tests/value/type-term.i.out b/examples/tests/value/type-term.i.out similarity index 100% rename from docs/std/tests/value/type-term.i.out rename to examples/tests/value/type-term.i.out diff --git a/package.json b/package.json index 0f6bc886..39f3152d 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "build": "tsc", "build:watch": "tsc --watch", "test:ts": "vitest --dir src --run", - "test:inet-parse": "test-runner test 'node ./bin/inet-js parse --no-color' 'docs/std/**/*.i'", - "test:inet-format": "test-runner test 'node ./bin/inet-js format --no-color' 'docs/std/**/*.i'", - "test:inet-run": "test-runner snapshot 'node ./bin/inet-js run --no-color' 'docs/std/**/*.i' --exclude 'docs/std/**/*.error.i'", - "test:inet-run-error": "test-runner snapshot-error 'node ./bin/inet-js run --no-color' 'docs/std/**/*.error.i'", + "test:inet-parse": "test-runner test 'node ./bin/inet-js parse --no-color' 'examples/**/*.i'", + "test:inet-format": "test-runner test 'node ./bin/inet-js format --no-color' 'examples/**/*.i'", + "test:inet-run": "test-runner snapshot 'node ./bin/inet-js run --no-color' 'examples/**/*.i' --exclude 'examples/**/*.error.i'", + "test:inet-run-error": "test-runner snapshot-error 'node ./bin/inet-js run --no-color' 'examples/**/*.error.i'", "test": "npm run test:ts && npm run test:inet-run && npm run test:inet-run-error", "format": "prettier src docs --write" }, diff --git a/src/command-line/commands/Format.ts b/src/command-line/commands/Format.ts index e3b6c1b9..6ace13b2 100644 --- a/src/command-line/commands/Format.ts +++ b/src/command-line/commands/Format.ts @@ -27,7 +27,7 @@ export class Format extends Command { return [ `Format a file:`, ``, - blue(` ${runner.name} ${this.name} std/datatype/Nat.test.i`), + blue(` ${runner.name} ${this.name} examples/datatype/Nat.test.i`), ``, ].join("\n") } diff --git a/src/command-line/commands/Parse.ts b/src/command-line/commands/Parse.ts index 32d10fcd..7ddaafab 100644 --- a/src/command-line/commands/Parse.ts +++ b/src/command-line/commands/Parse.ts @@ -26,7 +26,7 @@ export class Parse extends Command { return [ `Parse a file:`, ``, - blue(` ${runner.name} ${this.name} std/datatype/Nat.test.i`), + blue(` ${runner.name} ${this.name} examples/datatype/Nat.test.i`), ``, ].join("\n") } diff --git a/src/command-line/commands/Run.ts b/src/command-line/commands/Run.ts index 9eab3054..27e07462 100644 --- a/src/command-line/commands/Run.ts +++ b/src/command-line/commands/Run.ts @@ -26,11 +26,11 @@ export class Run extends Command { return [ `Run a file:`, ``, - blue(` ${runner.name} ${this.name} std/datatype/Nat.test.i`), + blue(` ${runner.name} ${this.name} examples/datatype/Nat.test.i`), ``, `Run a URL:`, ``, - blue(` ${runner.name} ${this.name} https://code-of-inet.xieyuheng.com/std/datatype/Nat.test.i`), + blue(` ${runner.name} ${this.name} https://code-of-inet.xieyuheng.com/examples/datatype/Nat.test.i`), ``, ].join("\n")