From 5220e72467f94092e6f50fbbad32606eb165f22d Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Sun, 1 Jun 2025 21:28:22 -0400 Subject: [PATCH 1/2] Simplify fp syntax a little. --- src/syntax/float.syn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syntax/float.syn b/src/syntax/float.syn index 6e8a861..5395d32 100644 --- a/src/syntax/float.syn +++ b/src/syntax/float.syn @@ -65,7 +65,6 @@ FP_T_EXPR: floating point constant, variable or function FP_FUNCS "(" FP_EXPR ")" ARRAY_FLOAT_ADDR emit TOK_FP_LOAD - emit { TOK_VAR_ADDR, VT_FLOAT } E_VAR_SEARCH "%" emit TOK_FP_LOAD INT_FUNCTIONS emit TOK_INT_FP FP_FUNCS: @@ -85,7 +84,7 @@ FP_FUNCS: "%Time" emit TOK_FP_TIME ADR_EXPR: - emit { TOK_VAR_LOAD, VT_ARRAY_FLOAT } E_VAR_SEARCH "%" + emit { TOK_VAR_LOAD, VT_ARRAY_FLOAT } E_VAR_SEARCH "%" emit { TOK_VAR_ADDR, VT_FLOAT } E_VAR_SEARCH "%" emit { TOK_NUM, VT_ARRAY_FLOAT } E_LABEL "%" @@ -109,7 +108,7 @@ COMP_OR_BOOL: emit TOK_INT_FP COMP_FP_RIGHT COMP_EXPR_MORE TEST_BOOL_EXPR: - emit TOK_INT_FP COMP_FP_RIGHT OR_EXPR_MORE AND_EXPR_MORE COMP_EXPR_MORE + emit TOK_INT_FP COMP_FP_RIGHT OR_EXPR_MORE AND_EXPR_MORE COMP_EXPR_MORE EXPR: FP_EXPR COMP_FP_RIGHT @@ -122,10 +121,11 @@ PRINT_ONE: FP_EXPR emit { TOK_FP_STR } INPUT_VAR: - VAR_FP_LVALUE_SADDR emit { TOK_INPUT_STR, TOK_FP_VAL, TOK_FP_STORE } + VAR_FP_LVALUE_SADDR emit { TOK_INPUT_STR, TOK_FP_VAL, TOK_FP_STORE } # Arrays ARRAY_FLOAT_ADDR: + emit { TOK_VAR_ADDR, VT_FLOAT } E_VAR_SEARCH "%" emit { TOK_VAR_LOAD, VT_ARRAY_FLOAT } E_VAR_SEARCH "%" emit TOK_PUSH PAR_EXPR emit { TOK_MUL6, TOK_ADD } emit { TOK_NUM, VT_ARRAY_FLOAT } E_LABEL "%" emit TOK_PUSH PAR_EXPR emit { TOK_MUL6, TOK_ADD } "%" PAR_EXPR @@ -135,7 +135,7 @@ DIM_VAR_TYPE:< "%" PAR_EXPR emit { TOK_PUSH_1, TOK_ADD, TOK_MUL6, VT_ARRAY_FLOAT } DIM_VAR: - emit { VT_FLOAT } E_VAR_SEARCH "%" E_PUSH_VAR + emit { VT_FLOAT } E_VAR_SEARCH "%" E_PUSH_VAR DATA_FLOATS: data number "," E_NUMBER_FP DATA_FLOATS From 19f41d41e527c1044dd99bc2a70cf82aa9148227 Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Sun, 1 Jun 2025 21:29:30 -0400 Subject: [PATCH 2/2] Fixes github "workflow does not contain permissions" check. The workflow should only be allowed to read from the repository. --- .github/workflows/c-cpp.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0c27bf0..5fb4f78 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -10,7 +10,9 @@ jobs: build-amd64: name: Build and run tests on Linux amd64 runs-on: ubuntu-22.04 - + permissions: + contents: read + pull-requests: read steps: - uses: actions/checkout@v4 with: @@ -35,6 +37,9 @@ jobs: build-macos-M1: name: Build and run tests on MacOS M1 (ARM64) runs-on: macos-14 + permissions: + contents: read + pull-requests: read steps: - uses: actions/checkout@v4 with: @@ -56,6 +61,9 @@ jobs: build-windows: name: Build and run tests on Windows runs-on: windows-2019 + permissions: + contents: read + pull-requests: read steps: - uses: actions/checkout@v4 with: