Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Building and testing ArkScript"
name: "Testing ArkScript"

on:
push:
Expand Down Expand Up @@ -165,14 +165,15 @@ jobs:
# Generic
cp lib/*.arkm artifact/lib
cp lib/std/*.ark artifact/lib/std
rm -rf artifact/lib/std/{.git,.github,tests/__arkscript__}
cp tests/unittests/*.arkm artifact/lib

- name: Organize temp artifact
shell: bash
run: |
mkdir -p temp/tests/unittests/
cp build/unittests temp/ || true
cp build/$BUILD_TYPE/unittests.exe temp/ || true
cp tests/unittests/*.arkm temp/tests/unittests
cp -r tests/unittests temp/tests/unittests

- name: Upload artifact
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
- execution contexts can be reused for async calls if they are not active, to avoid constantly requesting memory and creating (heavy) contexts
- if there is more than 5 contexts, the 6th one will be destroyed once it completes
- execution contexts are now marked as free to be reused (or deleted) once a value has been computed, without waiting for a call to `await`
- captures are not renamed anymore by the NameResolutionPass (which used to fully qualify captured names when possible, which isn't desirable: when you capture `&foo`, you expect to be able to use `.foo` not `.module:foo`)
- when loading a module, its mappings are loaded in the current scope instead of the global scope

### Removed
- removed unused `NodeType::Closure`
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ if (ARK_EMSCRIPTEN)
endif ()

if (ARK_TESTS)
add_subdirectory(${ark_SOURCE_DIR}/tests/unittests/TestModule)

file(GLOB_RECURSE SOURCES
${ark_SOURCE_DIR}/tests/unittests/*.cpp
${ark_SOURCE_DIR}/tests/unittests/Suites/*.cpp
Expand Down
7 changes: 4 additions & 3 deletions include/Ark/Ark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
*
*/

#ifndef INCLUDE_ARK_ARK_HPP
#define INCLUDE_ARK_ARK_HPP
#ifndef ARK_ARK_HPP
#define ARK_ARK_HPP

#include <Ark/Exceptions.hpp>
#include <Ark/Constants.hpp>
#include <Ark/Utils/Utils.hpp>
#include <Ark/VM/VM.hpp>
#include <Ark/VM/DefaultValues.hpp>
#include <Ark/Compiler/Welder.hpp>
#include <Ark/TypeChecker.hpp>

#endif
#endif // ARK_ARK_HPP
16 changes: 16 additions & 0 deletions include/Ark/Compiler/AST/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <ostream>
#include <string>
#include <vector>
#include <optional>

#include <Ark/Compiler/AST/Namespace.hpp>
#include <Ark/Compiler/Common.hpp>
Expand Down Expand Up @@ -125,6 +126,13 @@ namespace Ark::internal
*/
[[nodiscard]] bool isFunction() const noexcept;

/**
* @brief Get the unqualified name, if it has been set
*
* @return const std::optional<std::string>&
*/
[[nodiscard]] const std::optional<std::string>& getUnqualifiedName() const noexcept;

/**
* @brief Copy a node to the current one, while keeping the filename and position in the file
*
Expand All @@ -139,6 +147,13 @@ namespace Ark::internal
*/
void setNodeType(NodeType type) noexcept;

/**
* @brief Set the unqualified name (used by Capture nodes)
*
* @param name
*/
void setUnqualifiedName(const std::string& name) noexcept;

/**
* @brief Set the String object
*
Expand Down Expand Up @@ -252,6 +267,7 @@ namespace Ark::internal
private:
NodeType m_type { NodeType::Unused };
Value m_value;
std::optional<std::string> m_unqualified_name { std::nullopt }; ///< Used by Capture nodes, to have the FQN in the value, and the captured name here
// position of the node in the original code, useful when it comes to parser errors
std::size_t m_line = 0, m_col = 0;
std::string m_filename;
Expand Down
2 changes: 0 additions & 2 deletions include/Ark/Compiler/AST/utf8_char.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <string>
#include <limits>

#undef max

namespace Ark::internal
{
class utf8_char_t
Expand Down
Loading
Loading