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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
103 changes: 40 additions & 63 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
Expand All @@ -19,74 +8,62 @@ on:
schedule:
- cron: '34 12 * * 4'

env:
BUILD_TYPE: Release

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: autobuild
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
- language: c-cpp
build-mode: manual
os: ubuntu-24.04
- language: python
build-mode: none
os: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
cmake -Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DARK_SANITIZERS=On \
-DARK_BUILD_EXE=On -DARK_BUILD_MODULES=Off -DARK_TESTS=On
cmake --build build --config Release -j $(nproc)
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Setup compilers, dependencies, project and build
if: matrix.build-mode == 'manual'
uses: ./.github/workflows/setup-compilers
with:
os_name: ${{ matrix.os }}
compiler: clang
compiler_version: 16
sanitizers: Off
with_deps: false

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/setup-compilers/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ runs:
cmake -Bbuild \
-G "Visual Studio 17 2022" -T v143 \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DARK_SANITIZERS=${{ matrix.config.sanitizers }} \
-DARK_SANITIZERS=${{ inputs.sanitizers }} \
-DARK_COVERAGE=${{ inputs.coverage }} \
-DARK_BUILD_EXE=On \
-DARK_BUILD_MODULES=$ToggleModules -DARK_MOD_ALL=$ToggleModules -DARK_MOD_DRAFT=$ToggleModules \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include/Ark/Constants.hpp
/fuzzing/
/output/
/tmp/
.afl-tmin-temp-*
## Fuzzer crash triage
/fct-ok/
/fct-bad/
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ for (std::size_t i = 0, end = container.size(); i < end; i++)
* @file Lexer.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Tokenize ArkScript code
* @version 0.1
* @date 2020-10-27
*
* @copyright Copyright (c) 2020
* @copyright Copyright (c) 2025
*
*/

Expand All @@ -136,7 +135,6 @@ Snippet to recapitulate guidelines for headers:
* @file Lexer.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Tokenize ArkScript code
* @version 0.1
* @date 2020-10-27
*
* @copyright Copyright (c) 2020
Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Ark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Ark.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Includes the needed files to start using ArkScript
* @version 0.1
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2024
* @copyright Copyright (c) 2020-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Builtins/Builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Builtins.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Host the declaration of all the ArkScript builtins
* @version 0.1
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2021
* @copyright Copyright (c) 2020-2025
*
*/

Expand Down
7 changes: 3 additions & 4 deletions include/Ark/Compiler/AST/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Node.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief AST node used by the parser, optimizer and compiler
* @version 1.0
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2024
* @copyright Copyright (c) 2020-2025
*
*/

Expand Down Expand Up @@ -40,7 +39,7 @@ namespace Ark::internal
explicit Node(double value);
explicit Node(long value);
explicit Node(Keyword value);
explicit Node(Namespace namespace_);
explicit Node(const Namespace& namespace_);

/**
* @brief Return the string held by the value (if the node type allows it)
Expand Down Expand Up @@ -219,7 +218,7 @@ namespace Ark::internal
friend bool operator<(const Node& A, const Node& B);

private:
NodeType m_type;
NodeType m_type { NodeType::Unused };
Value m_value;
// position of the node in the original code, useful when it comes to parser errors
std::size_t m_line = 0, m_col = 0;
Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/AST/Optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Optimizer.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Optimizes a given ArkScript AST
* @version 1.1
* @date 2024-07-09
*
* @copyright Copyright (c) 2020-2024
* @copyright Copyright (c) 2020-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/AST/Parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Parser.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Parse ArkScript code, but do not handle any import declarations
* @version 0.2
* @date 2024-05-12
*
* @copyright Copyright (c) 2024
* @copyright Copyright (c) 2024-2025
*
*/

Expand Down
1 change: 0 additions & 1 deletion include/Ark/Compiler/BytecodeReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file BytecodeReader.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief A bytecode disassembler for ArkScript
* @version 1.0
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2025
Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Common.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Common code for the compiler
* @version 0.5
* @date 2021-10-02
*
* @copyright Copyright (c) 2021-2024
* @copyright Copyright (c) 2021-2025
*
*/

Expand Down
1 change: 0 additions & 1 deletion include/Ark/Compiler/Instructions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file Instructions.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief The different instructions used by the compiler and virtual machine
* @version 1.0
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2025
Expand Down
1 change: 0 additions & 1 deletion include/Ark/Compiler/IntermediateRepresentation/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file Entity.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief An entity in the IR is a bundle of information
* @version 1.0
* @date 2024-10-05
*
* @copyright Copyright (c) 2024-2025
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file IRCompiler.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Compile the intermediate representation to bytecode
* @version 0.2
* @date 2024-10-05
*
* @copyright Copyright (c) 2024-2025
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file IROptimizer.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Optimize IR based on IR entity grouped by 2 (or more)
* @version 0.2
* @date 2024-10-11
*
* @copyright Copyright (c) 2024
* @copyright Copyright (c) 2024-2025
*
*/
#ifndef ARK_COMPILER_INTERMEDIATEREPRESENTATION_IROPTIMIZER_HPP
Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/IntermediateRepresentation/Word.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Word.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Describe an instruction and its immediate argument
* @version 1.0
* @date 2022-07-02
*
* @copyright Copyright (c) 2022-2024
* @copyright Copyright (c) 2022-2025
*
*/

Expand Down
1 change: 0 additions & 1 deletion include/Ark/Compiler/Lowerer/ASTLowerer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file ASTLowerver.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief ArkScript compiler is in charge of transforming the AST into IR
* @version 3.1
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2025
Expand Down
1 change: 0 additions & 1 deletion include/Ark/Compiler/Lowerer/LocalsLocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file LocalsLocator.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Track locals at compile
* @version 0.1
* @date 2025-03-20
*
* @copyright Copyright (c) 2025
Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Macros/Executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Executor.hpp
* @author Ray John Alovera (rakista112@gmail.com), Alexandre Plateau (lexplt.dev@gmail.com)
* @brief The base class for all MacroExecutors
* @version 3.0
* @date 2024-03-03
*
* @copyright Copyright (c) 2021-2024
* @copyright Copyright (c) 2021-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Macros/Executors/Conditional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Conditional.hpp
* @author Ray John Alovera (rakista112@gmail.com), Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Executor for Conditional Macros
* @version 1.1
* @date 2021-05-04
*
* @copyright Copyright (c) 2021-2024
* @copyright Copyright (c) 2021-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Macros/Executors/Function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Function.hpp
* @author Ray John Alovera (rakista112@gmail.com), Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Executor for List Macros
* @version 3.0
* @date 2021-05-04
*
* @copyright Copyright (c) 2021-2024
* @copyright Copyright (c) 2021-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Macros/Executors/Symbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file Symbol.hpp
* @author Ray John Alovera (rakista112@gmail.com), Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Executor for Symbol Macros
* @version 1.1
* @date 2021-05-04
*
* @copyright Copyright (c) 2021-2024
* @copyright Copyright (c) 2021-2025
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/Ark/Compiler/Macros/MacroScope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file MacroScope.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief Defines tools to handle macro definitions
* @version 1.0
* @date 2023-02-18
*
* @copyright Copyright (c) 2023-2024
* @copyright Copyright (c) 2023-2025
*
*/

Expand Down
Loading
Loading