-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: I know some people have asked noot to depend on the sort.Slices, which is still flagged as experimental. However, it won't be one day it is well implemented. It is only used in one place in the runtime and two places in an optional build tag antlr.statistics, I advise users to make a fork if the really need to remove sort.Slice. Signed-off-by: Jim.Idle <jimi@idle.ws>
- Loading branch information
Showing
17 changed files
with
216 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/antlr4-go/antlr/v4 | ||
|
||
go 1.20 | ||
go 1.22 | ||
|
||
require golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc | ||
require golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= | ||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= | ||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= | ||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= | ||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= | ||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//go:build !antlr.nomutex | ||
// +build !antlr.nomutex | ||
|
||
package antlr | ||
|
||
import "sync" | ||
|
||
// Mutex is a simple mutex implementation which just delegates to sync.Mutex, it | ||
// is used to provide a mutex implementation for the antlr package, which users | ||
// can turn off with the build tag -tags antlr.nomutex | ||
type Mutex struct { | ||
mu sync.Mutex | ||
} | ||
|
||
func (m *Mutex) Lock() { | ||
m.mu.Lock() | ||
} | ||
|
||
func (m *Mutex) Unlock() { | ||
m.mu.Unlock() | ||
} | ||
|
||
type RWMutex struct { | ||
mu sync.RWMutex | ||
} | ||
|
||
func (m *RWMutex) Lock() { | ||
m.mu.Lock() | ||
} | ||
|
||
func (m *RWMutex) Unlock() { | ||
m.mu.Unlock() | ||
} | ||
|
||
func (m *RWMutex) RLock() { | ||
m.mu.RLock() | ||
} | ||
|
||
func (m *RWMutex) RUnlock() { | ||
m.mu.RUnlock() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//go:build antlr.nomutex | ||
// +build antlr.nomutex | ||
|
||
package antlr | ||
|
||
type Mutex struct{} | ||
|
||
func (m *Mutex) Lock() { | ||
// No-op | ||
} | ||
|
||
func (m *Mutex) Unlock() { | ||
// No-op | ||
} | ||
|
||
type RWMutex struct{} | ||
|
||
func (m *RWMutex) Lock() { | ||
// No-op | ||
} | ||
|
||
func (m *RWMutex) Unlock() { | ||
// No-op | ||
} | ||
|
||
func (m *RWMutex) RLock() { | ||
// No-op | ||
} | ||
|
||
func (m *RWMutex) RUnlock() { | ||
// No-op | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.