Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
66ee4f5
Replace JSONC plugin with C concrete-syntax parser foundation
claude Apr 30, 2026
e3048e6
Slice 2: multi-name typedef detection and smarter chomp termination
claude Apr 30, 2026
834dd5b
Slice 3: trivia preservation via sub-lex hook
claude Apr 30, 2026
844e338
Slice 4: structure external_declaration into a real CST
claude Apr 30, 2026
43611d1
Slice 5: structure struct/union/enum bodies into typed members
claude Apr 30, 2026
32eccde
Slice 6: parse statements inside compound_statement
claude Apr 30, 2026
fc8599f
Slice 7: structure preprocessor directives
claude Apr 30, 2026
32253a3
Slice 8: parse function parameter lists into typed nodes
claude Apr 30, 2026
1835f13
Slice 9: lex-time macro-name tagging via the macro table
claude Apr 30, 2026
6d184e9
Slice 10: structure call expressions with isMacro tagging
claude Apr 30, 2026
e258cac
Slice 11: nest preprocessor conditional groups
claude Apr 30, 2026
2a454a1
Slice 12: structured C expression parsing (Pratt + precedence)
claude Apr 30, 2026
c1391a6
Slice 13: end-to-end smoke tests on realistic C source
claude Apr 30, 2026
c07d38b
Slice 14: structure designated initializers and _Static_assert
claude Apr 30, 2026
c8c872c
Slice 15: structure _Generic associations
claude Apr 30, 2026
0916eeb
Update README to reflect the structured CST capabilities
claude Apr 30, 2026
85728b2
Slice 16: structure __attribute__ / __declspec contents
claude Apr 30, 2026
fe96ec3
Slice 17: structure GCC __asm__ template / operands / clobbers / labels
claude Apr 30, 2026
058ef44
Slice 18: structure C23 [[ … ]] attributes
claude Apr 30, 2026
6c6557e
Slice 19: split for_controls into init / cond / iter
claude Apr 30, 2026
235d0d2
Update README: backlog items now structured
claude Apr 30, 2026
d56bf46
Add csmith corpus and JSON-fixture regression test
claude Apr 30, 2026
890bf3b
csmith tests: don't require the csmith binary at test time
claude Apr 30, 2026
118c617
CI: drop references to deleted embed-grammar.js and go/ tree
claude Apr 30, 2026
163f88e
csmith tests: pin corpus to LF and normalise EOL on read
claude Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.json.gz binary

# Keep csmith corpus + plugin sources as LF on all platforms so the
# byte-exact fixtures (built on Linux) match the parser's output on
# Windows checkouts too. Without this, git's autocrlf would rewrite
# .c files to CRLF on Windows and the parser's token spans/sources
# would diverge from the committed LF fixtures.
*.c text eol=lf
*.h text eol=lf
*.ts text eol=lf
*.json text eol=lf
*.jsonic text eol=lf
*.md text eol=lf
*.yml text eol=lf
22 changes: 0 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,3 @@ jobs:
- run: npm i
- run: npm run build --if-present
- run: npm test

build-go:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Build
working-directory: go
run: go build ./...
- name: Test
working-directory: go
run: go test -v ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lib-cov
*.out
*.pid
*.gz
!test/csmith-fixtures/*.json.gz

pids
logs
Expand Down Expand Up @@ -34,3 +35,4 @@ yarn.lock

# Go
go/vendor/
platform.info
48 changes: 4 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,55 +1,15 @@
.PHONY: all build test clean embed build-ts build-go test-ts test-go clean-ts clean-go publish-go tags-go tidy-go reset
.PHONY: all build test clean reset

all: build test

build: build-ts build-go

test: test-ts test-go

clean: clean-ts clean-go

# Embed jsonc-grammar.jsonic into src/jsonc.ts and go/jsonc.go.
embed:
node embed-grammar.js

# TypeScript
build-ts:
build:
npm run build

test-ts:
test:
npm test

clean-ts:
clean:
rm -rf dist dist-test

# Go
build-go: embed
cd go && go build ./...

test-go:
cd go && go test ./...

clean-go:
cd go && go clean -cache

# Publish Go module: make publish-go V=0.1.1
publish-go: test-go
@test -n "$(V)" || (echo "Usage: make publish-go V=x.y.z" && exit 1)
sed -i '' 's/^const Version = ".*"/const Version = "$(V)"/' go/jsonc.go
git add go/jsonc.go
git commit -m "go: v$(V)"
git tag go/v$(V)
git push origin main go/v$(V)
if command -v gh >/dev/null 2>&1; then gh release create go/v$(V) --title "go/v$(V)" --notes "Go module release v$(V)"; fi

tidy-go:
cd go && go mod tidy

tags-go:
git tag -l 'go/v*' --sort=-version:refname

reset:
npm run reset
cd go && go clean -cache
cd go && go build ./...
cd go && go test -v ./...
Loading
Loading