Skip to content

Commit

Permalink
chore: 重新生成解释器代码,更加精简
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed May 15, 2024
1 parent 439ff14 commit a9675ef
Show file tree
Hide file tree
Showing 3 changed files with 487 additions and 1,273 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/jsport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Install gopherjs
run: |
go get -u github.com/gopherjs/[email protected]
go install github.com/gopherjs/[email protected]
go install github.com/gopherjs/[email protected]
- name: Build
run: gopherjs build github.com/sealdice/dicescript/jsport -o jsport/dicescript.cjs
Expand Down
4 changes: 3 additions & 1 deletion roll.peg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
//nolint:unreachable
package dicescript

{{ if not .grammarOnly }}

type ParserCustomData struct {
ParserData
}
Expand All @@ -24,12 +26,12 @@ func toStr(x []byte) string {
return string(x)
}

{{ end }}
}

// 出口
dicescript <- sp stmtRoot sp {
c.data.AddOp(typeHalt)
return nil
}

stmtRoot <- stmtLines sp
Expand Down
Loading

0 comments on commit a9675ef

Please sign in to comment.