aboutsummaryrefslogtreecommitdiff
path: root/spec/spec.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-05-25 21:55:17 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-05-25 21:57:45 +0900
commit520bf02582be7ab36b17fd78f8931cfdb702b07f (patch)
treea1e7ad54915152fce6f96a18312e28f34f256c84 /spec/spec.go
parentFix the initial state number (diff)
downloadtre-520bf02582be7ab36b17fd78f8931cfdb702b07f.tar.gz
tre-520bf02582be7ab36b17fd78f8931cfdb702b07f.tar.xz
Add fragment expression
A fragment entry is defined by an entry whose `fragment` field is `true`, and is referenced by a fragment expression (`\f{...}`).
Diffstat (limited to 'spec/spec.go')
-rw-r--r--spec/spec.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/spec.go b/spec/spec.go
index e3c318e..61955ac 100644
--- a/spec/spec.go
+++ b/spec/spec.go
@@ -88,11 +88,12 @@ func (n LexModeNum) IsNil() bool {
}
type LexEntry struct {
- Kind LexKind `json:"kind"`
- Pattern LexPattern `json:"pattern"`
- Modes []LexModeName `json:"modes"`
- Push LexModeName `json:"push"`
- Pop bool `json:"pop"`
+ Kind LexKind `json:"kind"`
+ Pattern LexPattern `json:"pattern"`
+ Modes []LexModeName `json:"modes"`
+ Push LexModeName `json:"push"`
+ Pop bool `json:"pop"`
+ Fragment bool `json:"fragment"`
}
func (e *LexEntry) validate() error {