Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

In vars.conf, you can currently only reference variables defined before current line. For example: #215

Open
rexim opened this issue Sep 28, 2020 · 0 comments

Comments

@rexim
Copy link
Member

rexim commented Sep 28, 2020

introduce in #209

Works:

PLAYER_SIZE   : float = 50

PLAYER_WIDTH  : float = PLAYER_SIZE

Does not work:

PLAYER_WIDTH  : float = PLAYER_SIZE

PLAYER_SIZE   : float = 50
rexim added a commit to justinsmid/something that referenced this issue Sep 28, 2020
@rexim rexim changed the title In config.vars, you can currently only reference variables defined before current line. For example: In vars.conf, you can currently only reference variables defined before current line. For example: Nov 1, 2020
JaroslawWiosna added a commit to JaroslawWiosna/something that referenced this issue Dec 18, 2020
to reproduce the issue

Before

```console
$ make -B baked_config.hpp && cat baked_config.hpp | grep PLAYER_TEXBOX
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum -O0 -fno-builtin -ggdb -o config_typer src/config_typer.cpp
"./config_typer" ./assets/vars.conf > config_types.hpp
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum `pkg-config --cflags sdl2` -O0 -fno-builtin -ggdb -o config_baker src/config_baker.cpp `pkg-config --libs sdl2 ` -lm
"./config_baker" > baked_config.hpp
define PLAYER_TEXBOX_W 50.000000f
define PLAYER_TEXBOX_H 50.000000f
```

After

```console
$ make -B baked_config.hpp && cat baked_config.hpp | grep PLAYER_TEXBOX
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum -O0 -fno-builtin -ggdb -o config_typer src/config_typer.cpp
"./config_typer" ./assets/vars.conf > config_types.hpp
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum `pkg-config --cflags sdl2` -O0 -fno-builtin -ggdb -o config_baker src/config_baker.cpp `pkg-config --libs sdl2 ` -lm
"./config_baker" > baked_config.hpp
define PLAYER_TEXBOX_W 0.000000f
define PLAYER_TEXBOX_H 0.000000f
define PLAYER_TEXBOX_SIZE 50.000000f
```
JaroslawWiosna added a commit to JaroslawWiosna/something that referenced this issue Dec 18, 2020
JaroslawWiosna added a commit to JaroslawWiosna/something that referenced this issue Dec 18, 2020
Closes tsoding#215

```console
$ make -B baked_config.hpp && cat baked_config.hpp | grep PLAYER_TEXBOX
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum -O0 -fno-builtin -ggdb -o config_typer src/config_typer.cpp
"./config_typer" ./assets/vars.conf > config_types.hpp
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum `pkg-config --cflags sdl2` -O0 -fno-builtin -ggdb -o config_baker src/config_baker.cpp `pkg-config --libs sdl2 ` -lm
"./config_baker" > baked_config.hpp
define PLAYER_TEXBOX_W 50.000000f
define PLAYER_TEXBOX_H 50.000000f
define PLAYER_TEXBOX_SIZE 50.000000f
```
JaroslawWiosna added a commit to JaroslawWiosna/something that referenced this issue Dec 18, 2020
JaroslawWiosna added a commit to JaroslawWiosna/something that referenced this issue Dec 18, 2020
```console
$ make -B baked_config.hpp && cat baked_config.hpp | grep -e " FOO" -e " BAR" -e " BAZZ"
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum -O0 -fno-builtin -ggdb -o config_typer src/config_typer.cpp
"./config_typer" ./assets/vars.conf > config_types.hpp
g++ -Wall -Wextra -Werror -pedantic -I. -std=c++17 -fno-exceptions -Wno-missing-braces -Wswitch-enum `pkg-config --cflags sdl2` -O0 -fno-builtin -ggdb -o config_baker src/config_baker.cpp `pkg-config --libs sdl2 ` -lm
"./config_baker" > baked_config.hpp
define FOO 0
define BAR 42
define BAZZ 42
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant