Skip to content

Commit 43a73d6

Browse files
committed
properly name note property lex tokens
1 parent 8e6964e commit 43a73d6

8 files changed

Lines changed: 1096 additions & 1096 deletions

File tree

ast/note.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ func (note *Note) IsPause() bool {
8484

8585
// NumSharp returns the number of sharp signs.
8686
func (note *Note) NumSharp() int {
87-
return note.countProps(tokentype.Sharp)
87+
return note.countProps(tokentype.PropSharp)
8888
}
8989

9090
// NumFlat reports the number of flat signs.
9191
func (note *Note) NumFlat() int {
92-
return note.countProps(tokentype.Flat)
92+
return note.countProps(tokentype.PropFlat)
9393
}
9494

9595
// NumAccents reports the number of accent properties in the note.
9696
func (note *Note) NumAccents() int {
97-
return note.countProps(tokentype.Accent)
97+
return note.countProps(tokentype.PropAccent)
9898
}
9999

100100
// NumGhosts reports the number of ghost properties in the note.
101101
func (note *Note) NumGhosts() int {
102-
return note.countProps(tokentype.Ghost)
102+
return note.countProps(tokentype.PropGhost)
103103
}
104104

105105
// Value returns the note value (1th, 2th, 4th, 8th, 16th, 32th and so on).
@@ -118,12 +118,12 @@ func (note *Note) Value() uint8 {
118118

119119
// NumDots reports the number of dot properties in the note.
120120
func (note *Note) NumDots() int {
121-
return note.countProps(tokentype.Dot)
121+
return note.countProps(tokentype.PropDot)
122122
}
123123

124124
// Tuplet returns the irregular division value if the note is a tuplet.
125125
func (note *Note) Tuplet() int {
126-
tok := note.Props.Find(tokentype.Tuplet)
126+
tok := note.Props.Find(tokentype.PropTuplet)
127127
if tok == nil {
128128
return 0
129129
}
@@ -137,7 +137,7 @@ func (note *Note) Tuplet() int {
137137

138138
// IsLetRing reports whether the note must ring.
139139
func (note *Note) IsLetRing() bool {
140-
return note.Props.Find(tokentype.LetRing) != nil
140+
return note.Props.Find(tokentype.PropLetRing) != nil
141141
}
142142

143143
func (note *Note) WriteTo(w io.Writer) (int64, error) {

ast/property_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewPropertyList(t *token.Token, inner interface{}) (PropertyList, error) {
5050
if err := validateNoteValue(v); err != nil {
5151
return nil, err
5252
}
53-
case tokentype.Tuplet.Type:
53+
case tokentype.PropTuplet.Type:
5454
v, err := strconv.Atoi(string(t.Lit[1:]))
5555
if err != nil {
5656
return nil, err

balafon.bnf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ cmdStop : ':' 's' 't' 'o' 'p' ;
2727
bracketBegin : '[' ;
2828
bracketEnd : ']' ;
2929

30-
rest : '-' ;
31-
sharp : '#' ;
32-
flat : '$' ;
33-
accent : '^' ;
34-
ghost : ')' ;
35-
dot : '.' ;
36-
tuplet : '/' '3' | '/' '5' ;
37-
letRing : '*' ;
30+
propRest : '-' ;
31+
propSharp : '#' ;
32+
propFlat : '$' ;
33+
propAccent : '^' ;
34+
propGhost : ')' ;
35+
propDot : '.' ;
36+
propTuplet : '/' '3' | '/' '5' ;
37+
propLetRing : '*' ;
3838

3939
_lineComment : '/' '/' { . } '\n' ;
4040
_blockComment : '/' '*' { . | '*' } '*' '/' ;
@@ -97,7 +97,7 @@ NoteObject
9797

9898
NoteSymbol
9999
: symbol
100-
| rest
100+
| propRest
101101
;
102102

103103
PropertyList
@@ -106,14 +106,14 @@ PropertyList
106106
;
107107

108108
Property
109-
: sharp
110-
| flat
111-
| accent
112-
| ghost
109+
: propSharp
110+
| propFlat
111+
| propAccent
112+
| propGhost
113113
| uint
114-
| dot
115-
| tuplet
116-
| letRing
114+
| propDot
115+
| propTuplet
116+
| propLetRing
117117
;
118118

119119
TopLevelCommand

0 commit comments

Comments
 (0)