Skip to content

Commit 603e02a

Browse files
committed
update cangjie version and add CI
1 parent 92779d3 commit 603e02a

3 files changed

Lines changed: 40 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: Build on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest, macos-arm64]
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Cangjie
17+
uses: Zxilly/setup-cangjie@v1.8.0
18+
with:
19+
channel: lts
20+
version: 1.0.0
21+
tool-cache: true
22+
archive-path: ./cangjie-archive
23+
24+
- name: Build
25+
run: cjpm build
26+
27+
- name: Test
28+
run: cjpm test

cjpm.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
[package]
2-
cjc-version = "0.53.18"
3-
compile-option = "--dy-std --dy-libs -O2"
4-
description = "C enum macro"
5-
link-option = ""
2+
cjc-version = "1.0.0"
63
name = "cenum"
7-
output-type = "dynamic"
8-
src-dir = ""
4+
description = "C enum macro"
5+
version = "1.1.0"
96
target-dir = ""
10-
version = "1.0.0"
7+
src-dir = ""
8+
output-type = "dynamic"
9+
compile-option = "--dy-std --dy-libs -O2"
10+
override-compile-option = ""
11+
link-option = ""
1112
package-configuration = {}
13+
14+
[dependencies]

src/common.cj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ private func enumBlockBegin(visibility: Token, name: Token, valueType: Token, ad
6161
public operator const func >=(right: $(name)): Bool {
6262
value >= right.value
6363
}
64-
)
65-
)
64+
))
6665
if (addFlagOps) {
6766
block.append(
6867
quote(
@@ -89,8 +88,7 @@ private func enumBlockBegin(visibility: Token, name: Token, valueType: Token, ad
8988
public const func isSet(right: $(name)): Bool {
9089
(value & right.value) != 0
9190
}
92-
)
93-
)
91+
))
9492
}
9593
return block
9694
}

0 commit comments

Comments
 (0)