add some code
Some checks are pending
CI / Build on Racket 'stable' (BC) (push) Waiting to run
CI / Build on Racket 'stable' (CS) (push) Waiting to run
CI / Build on Racket 'current' (BC) (push) Waiting to run
CI / Build on Racket 'current' (CS) (push) Waiting to run

This commit is contained in:
Tan, Kian-ting 2025-09-29 21:51:40 +08:00
parent 28453d20c7
commit 1a85b617c4
2 changed files with 36 additions and 6 deletions

29
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,29 @@
on: [push, pull_request]
name: CI
jobs:
build:
name: "Build on Racket '${{ matrix.racket-version }}' (${{ matrix.racket-variant }})"
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
racket-version: ["stable", "current"]
racket-variant: ["BC", "CS"]
include:
- racket-version: current
experimental: true
steps:
- uses: actions/checkout@v4
- uses: Bogdanp/setup-racket@v1.12
with:
architecture: x64
distribution: full
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}
- name: Installing uahgi2 and its dependencies
run: raco pkg install --no-docs --auto --name uahgi2
- name: Compiling uahgi2 and building its docs
run: raco setup --check-pkg-deps --unused-pkg-deps uahgi2
- name: Testing uahgi2
run: raco test -x -p uahgi2

View file

@ -1,6 +1,4 @@
#lang br/quicklang #lang br/quicklang
(require syntax/parse/define)
(define paperwidth #f) (define paperwidth #f)
(define paperheight #f) (define paperheight #f)
(define (set x y) (set! x y)) (define (set x y) (set! x y))
@ -21,14 +19,17 @@
(define-macro-cases u-expr (define-macro-cases u-expr
[(u-expr (u-atom ITEM)) #'ITEM] [(u-expr (u-atom ITEM)) #'ITEM]
[(u-expr (u-converting-num (u-number NUM))) #'NUM] [(u-expr (u-converting-num (u-number NUM))) #'NUM]
[(u-expr X) #'X]) [(u-expr X) #'X])
(define-macro-cases u-sexp (define-macro-cases u-sexp
[(u-sexp (u-expr (u-atom (u-id "set"))) X Y) #'(set! X Y)] [(u-sexp (u-expr (u-atom (u-id "set"))) X Y) #'(set! X Y)]
[(u-sexp X Y) #'[X Y]] ;[(u-sexp X Y) #'[X Y]]
[(u-sexp REQ OPT ...) [(u-sexp REQ OPT ...)
#'(let ([head REQ]) #'(let ([head REQ]
(eval `(,head OPT ...)))] (namespace (current-namespace)))
(begin
(println (namespace-mapped-symbols namespace))
((namespace-variable-value head namespace) OPT ...)))]
) )
(define-macro (u-module-begin (u-program LINE ...)) (define-macro (u-module-begin (u-program LINE ...))