Skip to content

Commit

Permalink
chore: generate parser
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Oct 31, 2023
2 parents 4d54672 + c4c3939 commit 9658349
Show file tree
Hide file tree
Showing 8 changed files with 3,840 additions and 3,311 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/jsport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build Js Port
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
push:
paths:
- '**.go'
- 'go.mod'
- '**.peg'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '**.peg'

name: Test & Lint

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: stable
- run: go install github.com/pointlander/[email protected]
- run: peg -switch -inline roll.peg
- run: go mod tidy
- run: go get
- run: go generate ./...
- run: go test -v -race -cover ./...

lint:
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: stable
- run: go install github.com/pointlander/[email protected]
- run: peg -switch -inline roll.peg
- run: go mod tidy
- run: go get
- run: go generate ./...
- name: Go vet
run: go vet ./...

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
if: github.event.name == 'pull_request'
with:
go-version: '1.18'
version: 'v1.51.2'
args: '--timeout 9999s'
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
if: github.event.name != 'pull_request'
with:
version: 'v1.51.2'
args: '--timeout 9999s'
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func main() {
})

if f, err := os.Open(historyFn); err == nil {
line.ReadHistory(f)
f.Close()
_, _ = line.ReadHistory(f)
_ = f.Close()
}

attrs := map[string]*dice.VMValue{}
Expand Down Expand Up @@ -94,7 +94,7 @@ func main() {
return nil
}

for true {
for {
if text, err := line.Prompt(">>> "); err == nil {
if strings.TrimSpace(text) == "" {
continue
Expand Down
Loading

0 comments on commit 9658349

Please sign in to comment.