From f295692b5040fb8ca61df6fd43cba3e544202f19 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 17 May 2018 23:41:20 -0400 Subject: [PATCH] Update copyright to 2018. Add string methods. --- CMakeLists.txt | 8 +- LICENSE | 2 +- src/assembler/asm.c | 2 +- src/compiler/compile.c | 2 +- src/compiler/run.c | 2 +- src/compiler/specials.c | 2 +- src/compiler/stl.c | 4 +- src/core/abstract.c | 2 +- src/core/array.c | 3 +- src/core/buffer.c | 3 +- src/core/bytecode.c | 2 +- src/core/corelib.c | 35 +----- src/core/fiber.c | 3 +- src/core/fiber.h | 2 +- src/core/gc.c | 2 +- src/core/gc.h | 2 +- src/core/io.c | 3 +- src/core/math.c | 3 +- src/core/native.c | 2 +- src/core/os.c | 3 +- src/core/state.h | 2 +- src/core/string.c | 158 +++++++++++++++++++++++++- src/core/strtod.c | 2 +- src/core/struct.c | 2 +- src/core/symcache.c | 2 +- src/core/symcache.h | 2 +- src/core/table.c | 3 +- src/core/tuple.c | 3 +- src/core/util.c | 2 +- src/core/util.h | 2 +- src/core/value.c | 2 +- src/core/vm.c | 2 +- src/core/wrap.c | 2 +- src/include/dst/dst.h | 2 +- src/include/dst/dstasm.h | 2 +- src/include/dst/dstcompile.h | 2 +- src/include/dst/dstconfig.h | 2 +- src/include/dst/dstcorelib.h | 17 +-- src/include/dst/dstopcodes.h | 2 +- src/include/dst/dstparse.h | 2 +- src/include/dst/dsttypes.h | 2 +- src/include/headerlibs/strbinsearch.h | 2 +- src/include/headerlibs/vector.h | 2 +- src/mainclient/init.dst | 2 + src/mainclient/line.c | 2 +- src/mainclient/line.h | 2 +- src/mainclient/main.c | 2 +- src/parser/ast.c | 2 +- src/parser/parse.c | 2 +- test/suite0.dst | 2 +- test/suite1.dst | 3 +- 51 files changed, 221 insertions(+), 102 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7674ff90..b6a60393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Calvin Rose +# Copyright (c) 2018 Calvin Rose # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to @@ -67,10 +67,10 @@ src/core/value.c src/core/vm.c src/core/wrap.c -src/core/gc.h src/core/fiber.h -src/core/symcache.h +src/core/gc.h src/core/state.h +src/core/symcache.h src/core/util.h ) @@ -104,9 +104,9 @@ src/include/dst/dst.h src/include/dst/dstasm.h src/include/dst/dstcompile.h src/include/dst/dstconfig.h +src/include/dst/dstcorelib.h src/include/dst/dstopcodes.h src/include/dst/dstparse.h -src/include/dst/dstcorelib.h src/include/dst/dsttypes.h ) diff --git a/LICENSE b/LICENSE index 4e5a480d..825749bf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 Calvin Rose +Copyright (c) 2018 Calvin Rose Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/assembler/asm.c b/src/assembler/asm.c index 3a9cedc0..1187a451 100644 --- a/src/assembler/asm.c +++ b/src/assembler/asm.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/compile.c b/src/compiler/compile.c index 9c8ac579..1781b098 100644 --- a/src/compiler/compile.c +++ b/src/compiler/compile.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/run.c b/src/compiler/run.c index ffdbe8e6..2492fd4c 100644 --- a/src/compiler/run.c +++ b/src/compiler/run.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/specials.c b/src/compiler/specials.c index 17d6f21b..40f413b0 100644 --- a/src/compiler/specials.c +++ b/src/compiler/specials.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/compiler/stl.c b/src/compiler/stl.c index ec96af6f..8404e67c 100644 --- a/src/compiler/stl.c +++ b/src/compiler/stl.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -56,7 +56,6 @@ static const DstReg cfuns[] = { {"type", dst_core_type}, {"next", dst_core_next}, {"hash", dst_core_hash}, - {"string.slice", dst_core_string_slice}, {NULL, NULL} }; @@ -104,6 +103,7 @@ DstTable *dst_stl_env(int flags) { dst_lib_parse(args); dst_lib_compile(args); dst_lib_asm(args); + dst_lib_string(args); } /* Allow references to the environment */ diff --git a/src/core/abstract.c b/src/core/abstract.c index f445f98a..cc1e0bf9 100644 --- a/src/core/abstract.c +++ b/src/core/abstract.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/array.c b/src/core/array.c index 1e810213..4e2bcfa3 100644 --- a/src/core/array.c +++ b/src/core/array.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include "gc.h" /* Initializes an array */ diff --git a/src/core/buffer.c b/src/core/buffer.c index 0204c82d..a550a2a5 100644 --- a/src/core/buffer.c +++ b/src/core/buffer.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include "gc.h" /* Initialize a buffer */ diff --git a/src/core/bytecode.c b/src/core/bytecode.c index 5ea4b573..f64eb84e 100644 --- a/src/core/bytecode.c +++ b/src/core/bytecode.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/corelib.c b/src/core/corelib.c index f103e167..4db69660 100644 --- a/src/core/corelib.c +++ b/src/core/corelib.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -305,36 +305,3 @@ int dst_core_hash(DstArgs args) { DST_FIXARITY(args, 1); DST_RETURN_INTEGER(args, dst_hash(args.v[0])); } - -int dst_core_string_slice(DstArgs args) { - const uint8_t *data; - int32_t len, start, end; - const uint8_t *ret; - DST_MINARITY(args, 1); - DST_MAXARITY(args, 3); - DST_ARG_BYTES(data, len, args, 0); - /* Get start */ - if (args.n < 2) { - start = 0; - } else if (dst_checktype(args.v[1], DST_INTEGER)) { - start = dst_unwrap_integer(args.v[1]); - } else { - DST_THROW(args, "expected integer"); - } - /* Get end */ - if (args.n < 3) { - end = -1; - } else if (dst_checktype(args.v[2], DST_INTEGER)) { - end = dst_unwrap_integer(args.v[2]); - } else { - DST_THROW(args, "expected integer"); - } - if (start < 0) start = len + start; - if (end < 0) end = len + end + 1; - if (end >= start) { - ret = dst_string(data + start, end - start); - } else { - ret = dst_cstring(""); - } - DST_RETURN_STRING(args, ret); -} diff --git a/src/core/fiber.c b/src/core/fiber.c index 50b202f0..8ef6e44e 100644 --- a/src/core/fiber.c +++ b/src/core/fiber.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -22,6 +22,7 @@ #include #include +#include #include "fiber.h" #include "gc.h" diff --git a/src/core/fiber.h b/src/core/fiber.h index 323115fa..000b02ee 100644 --- a/src/core/fiber.h +++ b/src/core/fiber.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/gc.c b/src/core/gc.c index da92b079..0759a457 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/gc.h b/src/core/gc.h index e68cb48c..707a1ef0 100644 --- a/src/core/gc.h +++ b/src/core/gc.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/io.c b/src/core/io.c index cc559be8..71b803cf 100644 --- a/src/core/io.c +++ b/src/core/io.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include #define IO_WRITE 1 diff --git a/src/core/math.c b/src/core/math.c index bb1de96d..b8fb31af 100644 --- a/src/core/math.c +++ b/src/core/math.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include /* Get a random number */ diff --git a/src/core/native.c b/src/core/native.c index e39557c8..61c0ac0d 100644 --- a/src/core/native.c +++ b/src/core/native.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/os.c b/src/core/os.c index 772def65..245ee4dc 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include #include diff --git a/src/core/state.h b/src/core/state.h index 3cb927f5..3fb6c5bc 100644 --- a/src/core/state.h +++ b/src/core/state.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/string.c b/src/core/string.c index da89457a..2254d256 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include "gc.h" #include "util.h" @@ -501,3 +502,158 @@ void dst_puts(const uint8_t *str) { putc(str[i], stdout); } } + +/* CFuns */ + +static int cfun_slice(DstArgs args) { + const uint8_t *data; + int32_t len, start, end; + const uint8_t *ret; + DST_MINARITY(args, 1); + DST_MAXARITY(args, 3); + DST_ARG_BYTES(data, len, args, 0); + /* Get start */ + if (args.n < 2) { + start = 0; + } else if (dst_checktype(args.v[1], DST_INTEGER)) { + start = dst_unwrap_integer(args.v[1]); + } else { + DST_THROW(args, "expected integer"); + } + /* Get end */ + if (args.n < 3) { + end = -1; + } else if (dst_checktype(args.v[2], DST_INTEGER)) { + end = dst_unwrap_integer(args.v[2]); + } else { + DST_THROW(args, "expected integer"); + } + if (start < 0) start = len + start; + if (end < 0) end = len + end + 1; + if (end >= start) { + ret = dst_string(data + start, end - start); + } else { + ret = dst_cstring(""); + } + DST_RETURN_STRING(args, ret); +} + +static int cfun_repeat(DstArgs args) { + const uint8_t *data; + uint8_t *newbuf, *p, *end; + int32_t len, rep; + int64_t mulres; + DST_FIXARITY(args, 2); + DST_ARG_BYTES(data, len, args, 0); + DST_ARG_INTEGER(rep, args, 1); + if (rep < 0) { + DST_THROW(args, "expected non-negative number of repetitions"); + } else if (rep == 0) { + DST_RETURN_CSTRING(args, ""); + } + mulres = (int64_t) rep * len; + if (mulres > INT32_MAX) { + DST_THROW(args, "result string is too long"); + } + newbuf = dst_string_begin((int32_t) mulres); + end = newbuf + mulres; + for (p = newbuf; p < end; p += len) { + memcpy(p, data, len); + } + DST_RETURN_STRING(args, dst_string_end(newbuf)); +} + +static int cfun_bytes(DstArgs args) { + const uint8_t *str; + int32_t strlen, i; + Dst *tup; + DST_FIXARITY(args, 1); + DST_ARG_BYTES(str, strlen, args, 0); + tup = dst_tuple_begin(strlen); + for (i = 0; i < strlen; i++) { + tup[i] = dst_wrap_integer((int32_t) str[i]); + } + DST_RETURN_TUPLE(args, dst_tuple_end(tup)); +} + +static int cfun_frombytes(DstArgs args) { + int32_t i; + uint8_t *buf; + for (i = 0; i < args.n; i++) { + DST_CHECK(args, i, DST_INTEGER); + } + buf = dst_string_begin(args.n); + for (i = 0; i < args.n; i++) { + int32_t c; + DST_ARG_INTEGER(c, args, i); + buf[i] = c & 0xFF; + } + DST_RETURN_STRING(args, dst_string_end(buf)); +} + +static int cfun_asciilower(DstArgs args) { + const uint8_t *str; + uint8_t *buf; + int32_t len, i; + DST_FIXARITY(args, 1); + DST_ARG_BYTES(str, len, args, 0); + buf = dst_string_begin(len); + for (i = 0; i < len; i++) { + uint8_t c = str[i]; + if (c >= 65 && c <= 90) { + buf[i] = c + 32; + } else { + buf[i] = c; + } + } + DST_RETURN_STRING(args, dst_string_end(buf)); +} + +static int cfun_asciiupper(DstArgs args) { + const uint8_t *str; + uint8_t *buf; + int32_t len, i; + DST_FIXARITY(args, 1); + DST_ARG_BYTES(str, len, args, 0); + buf = dst_string_begin(len); + for (i = 0; i < len; i++) { + uint8_t c = str[i]; + if (c >= 97 && c <= 122) { + buf[i] = c - 32; + } else { + buf[i] = c; + } + } + DST_RETURN_STRING(args, dst_string_end(buf)); +} + +static int cfun_reverse(DstArgs args) { + const uint8_t *str; + uint8_t *buf; + int32_t len, i, j; + DST_FIXARITY(args, 1); + DST_ARG_BYTES(str, len, args, 0); + buf = dst_string_begin(len); + for (i = 0, j = len - 1; i < len; i++, j--) { + buf[i] = str[j]; + } + DST_RETURN_STRING(args, dst_string_end(buf)); +} + +static const DstReg cfuns[] = { + {"string.slice", cfun_slice}, + {"string.repeat", cfun_repeat}, + {"string.bytes", cfun_bytes}, + {"string.from-bytes", cfun_frombytes}, + {"string.ascii-lower", cfun_asciilower}, + {"string.ascii-upper", cfun_asciiupper}, + {"string.reverse", cfun_reverse}, + {NULL, NULL} +}; + +/* Module entry point */ +int dst_lib_string(DstArgs args) { + DstTable *env = dst_env_arg(args); + dst_env_cfuns(env, cfuns); + return 0; +} diff --git a/src/core/strtod.c b/src/core/strtod.c index d2a3f2ec..de3c76cb 100644 --- a/src/core/strtod.c +++ b/src/core/strtod.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/struct.c b/src/core/struct.c index 21a1054d..e5b0bb2f 100644 --- a/src/core/struct.c +++ b/src/core/struct.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/symcache.c b/src/core/symcache.c index f4101807..4d90157c 100644 --- a/src/core/symcache.c +++ b/src/core/symcache.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/symcache.h b/src/core/symcache.h index 9e1f71cd..305e1223 100644 --- a/src/core/symcache.h +++ b/src/core/symcache.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/table.c b/src/core/table.c index a3e168e9..085894a1 100644 --- a/src/core/table.c +++ b/src/core/table.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include "gc.h" #include "util.h" diff --git a/src/core/tuple.c b/src/core/tuple.c index c651c183..f1254dbd 100644 --- a/src/core/tuple.c +++ b/src/core/tuple.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -21,6 +21,7 @@ */ #include +#include #include "symcache.h" #include "gc.h" #include "util.h" diff --git a/src/core/util.c b/src/core/util.c index 37ad6e8f..66679df4 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/util.h b/src/core/util.h index 5677d016..f993a76d 100644 --- a/src/core/util.h +++ b/src/core/util.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/value.c b/src/core/value.c index 6e1bbbb9..80cc978a 100644 --- a/src/core/value.c +++ b/src/core/value.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/vm.c b/src/core/vm.c index b0232820..bda273f8 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/core/wrap.c b/src/core/wrap.c index 1bc0968a..b86ccd3d 100644 --- a/src/core/wrap.c +++ b/src/core/wrap.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dst.h b/src/include/dst/dst.h index 562bf365..626326db 100644 --- a/src/include/dst/dst.h +++ b/src/include/dst/dst.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dstasm.h b/src/include/dst/dstasm.h index 63e15d58..34da1325 100644 --- a/src/include/dst/dstasm.h +++ b/src/include/dst/dstasm.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dstcompile.h b/src/include/dst/dstcompile.h index 1eb39448..f5ebf86f 100644 --- a/src/include/dst/dstcompile.h +++ b/src/include/dst/dstcompile.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dstconfig.h b/src/include/dst/dstconfig.h index 2c7ad118..3afc8a0f 100644 --- a/src/include/dst/dstconfig.h +++ b/src/include/dst/dstconfig.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dstcorelib.h b/src/include/dst/dstcorelib.h index 6cb20430..77dd4681 100644 --- a/src/include/dst/dstcorelib.h +++ b/src/include/dst/dstcorelib.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -42,18 +42,6 @@ int dst_divide(DstArgs args); int dst_modulo(DstArgs args); int dst_rand(DstArgs args); int dst_srand(DstArgs args); -int dst_strict_equal(DstArgs args); -int dst_strict_notequal(DstArgs args); -int dst_ascending(DstArgs args); -int dst_descending(DstArgs args); -int dst_notdescending(DstArgs args); -int dst_notascending(DstArgs args); -int dst_numeric_eq(DstArgs args); -int dst_numeric_neq(DstArgs args); -int dst_numeric_gt(DstArgs args); -int dst_numeric_lt(DstArgs args); -int dst_numeric_gte(DstArgs args); -int dst_numeric_lte(DstArgs args); int dst_bor(DstArgs args); int dst_band(DstArgs args); int dst_bxor(DstArgs args); @@ -61,7 +49,6 @@ int dst_bnot(DstArgs args); int dst_lshift(DstArgs args); int dst_rshift(DstArgs args); int dst_lshiftu(DstArgs args); -int dst_not(DstArgs args); /* Math */ int dst_cos(DstArgs args); @@ -100,7 +87,6 @@ int dst_core_put(DstArgs args); int dst_core_type(DstArgs args); int dst_core_next(DstArgs args); int dst_core_hash(DstArgs args); -int dst_core_string_slice(DstArgs args); /* GC */ int dst_core_gccollect(DstArgs args); @@ -116,6 +102,7 @@ int dst_lib_buffer(DstArgs args); int dst_lib_table(DstArgs args); int dst_lib_fiber(DstArgs args); int dst_lib_os(DstArgs args); +int dst_lib_string(DstArgs args); /* Useful for compiler */ Dst dst_op_add(Dst lhs, Dst rhs); diff --git a/src/include/dst/dstopcodes.h b/src/include/dst/dstopcodes.h index 88a74a74..ca59e0ad 100644 --- a/src/include/dst/dstopcodes.h +++ b/src/include/dst/dstopcodes.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dstparse.h b/src/include/dst/dstparse.h index 9c4fbf4e..070e3118 100644 --- a/src/include/dst/dstparse.h +++ b/src/include/dst/dstparse.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/dst/dsttypes.h b/src/include/dst/dsttypes.h index 92848921..49587c6c 100644 --- a/src/include/dst/dsttypes.h +++ b/src/include/dst/dsttypes.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/headerlibs/strbinsearch.h b/src/include/headerlibs/strbinsearch.h index cc6e2203..f7d91b7a 100644 --- a/src/include/headerlibs/strbinsearch.h +++ b/src/include/headerlibs/strbinsearch.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/include/headerlibs/vector.h b/src/include/headerlibs/vector.h index 34e1a13d..192d4521 100644 --- a/src/include/headerlibs/vector.h +++ b/src/include/headerlibs/vector.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/mainclient/init.dst b/src/mainclient/init.dst index 12c4d0cf..369b3b66 100644 --- a/src/mainclient/init.dst +++ b/src/mainclient/init.dst @@ -1,3 +1,5 @@ +# Copyright 2017-2018 (C) Calvin Rose + (do (var *should-repl* :private false) diff --git a/src/mainclient/line.c b/src/mainclient/line.c index fea9b697..702b54b8 100644 --- a/src/mainclient/line.c +++ b/src/mainclient/line.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/mainclient/line.h b/src/mainclient/line.h index 3486e52b..6b0a7aef 100644 --- a/src/mainclient/line.h +++ b/src/mainclient/line.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/mainclient/main.c b/src/mainclient/main.c index 5923fc58..05e53500 100644 --- a/src/mainclient/main.c +++ b/src/mainclient/main.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/parser/ast.c b/src/parser/ast.c index 38055daf..47de3782 100644 --- a/src/parser/ast.c +++ b/src/parser/ast.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/src/parser/parse.c b/src/parser/parse.c index 231c2736..c3dd1ab3 100644 --- a/src/parser/parse.c +++ b/src/parser/parse.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 Calvin Rose +* Copyright (c) 2018 Calvin Rose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to diff --git a/test/suite0.dst b/test/suite0.dst index 6a4d568c..f5f0ee48 100644 --- a/test/suite0.dst +++ b/test/suite0.dst @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Calvin Rose +# Copyright (c) 2018 Calvin Rose # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to diff --git a/test/suite1.dst b/test/suite1.dst index abbb23da..631d2118 100644 --- a/test/suite1.dst +++ b/test/suite1.dst @@ -1,6 +1,5 @@ -# Copyright (c) 2017 Calvin Rose +# Copyright (c) 2018 Calvin Rose -# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the