From 240b015429e7b790894beb49239cfa2b9785585e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kalp=20=C3=96zcan?= Date: Thu, 1 Jan 2026 15:30:34 +1100 Subject: [PATCH 1/2] Add test .flecs files in LF & CRLF formats --- _REPRO/crlf-script-loading/test.CRLF.flecs | 22 ++++++++++++++++++++++ _REPRO/crlf-script-loading/test.LF.flecs | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 _REPRO/crlf-script-loading/test.CRLF.flecs create mode 100644 _REPRO/crlf-script-loading/test.LF.flecs diff --git a/_REPRO/crlf-script-loading/test.CRLF.flecs b/_REPRO/crlf-script-loading/test.CRLF.flecs new file mode 100644 index 0000000000..84efaf1b19 --- /dev/null +++ b/_REPRO/crlf-script-loading/test.CRLF.flecs @@ -0,0 +1,22 @@ +using flecs.meta + +struct MaxSpeed { + value = f32 +} + +struct Position { + x = f32 + y = f32 +} + +prefab SpaceShip { + MaxSpeed: {value: 100} + + cockpit { + Position: {x: -10, y: 0} + } +} + +my_spaceship : SpaceShip { + Position: {x: 10, y: 20} +} diff --git a/_REPRO/crlf-script-loading/test.LF.flecs b/_REPRO/crlf-script-loading/test.LF.flecs new file mode 100644 index 0000000000..84efaf1b19 --- /dev/null +++ b/_REPRO/crlf-script-loading/test.LF.flecs @@ -0,0 +1,22 @@ +using flecs.meta + +struct MaxSpeed { + value = f32 +} + +struct Position { + x = f32 + y = f32 +} + +prefab SpaceShip { + MaxSpeed: {value: 100} + + cockpit { + Position: {x: -10, y: 0} + } +} + +my_spaceship : SpaceShip { + Position: {x: 10, y: 20} +} From 4357f4b9f5f9a5fa68fe652a3f8f6df41c446e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kalp=20=C3=96zcan?= Date: Thu, 1 Jan 2026 15:56:30 +1100 Subject: [PATCH 2/2] Add the repro script --- _REPRO/crlf-script-loading/build-repro.sh | 5 +++++ _REPRO/crlf-script-loading/repro.cpp | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 _REPRO/crlf-script-loading/build-repro.sh create mode 100644 _REPRO/crlf-script-loading/repro.cpp diff --git a/_REPRO/crlf-script-loading/build-repro.sh b/_REPRO/crlf-script-loading/build-repro.sh new file mode 100755 index 0000000000..b6e4f25722 --- /dev/null +++ b/_REPRO/crlf-script-loading/build-repro.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -ex + +gcc-15 -c ../../distr/flecs.c -std=c99 -O2 -o flecs.o +g++-15 repro.cpp flecs.o -o repro -std=c++17 -lpthread diff --git a/_REPRO/crlf-script-loading/repro.cpp b/_REPRO/crlf-script-loading/repro.cpp new file mode 100644 index 0000000000..db22cb6f68 --- /dev/null +++ b/_REPRO/crlf-script-loading/repro.cpp @@ -0,0 +1,21 @@ +#include +#include "../../distr/flecs.h" + +int main(int argc, char* argv[]) { + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " " << std::endl; + return 1; + } + + flecs::world world; + + // Run the Flecs script file + if (world.script_run_file(argv[1]) != 0) { + std::cerr << "Error running script" << std::endl; + return 1; + } + + std::cout << "Script '" << argv[1] << "' executed successfully." << std::endl; + + return 0; +}