1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

scanner: fix a typo in right_shift

This commit is contained in:
Major Taylor 2020-02-28 11:16:24 -05:00 committed by GitHub
parent 10e15e5de7
commit ee9cfe22ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -623,7 +623,7 @@ pub fn (s mut Scanner) scan() token.Token {
else if nextc == `>` { else if nextc == `>` {
if s.pos + 2 < s.text.len && s.text[s.pos + 2] == `=` { if s.pos + 2 < s.text.len && s.text[s.pos + 2] == `=` {
s.pos += 2 s.pos += 2
return s.scan_res(.righ_shift_assign, '') return s.scan_res(.right_shift_assign, '')
} }
s.pos++ s.pos++
return s.scan_res(.right_shift, '') return s.scan_res(.right_shift, '')

View File

@ -54,7 +54,7 @@ pub enum Kind {
mod_assign mod_assign
or_assign or_assign
and_assign and_assign
righ_shift_assign right_shift_assign
left_shift_assign left_shift_assign
// {} () [] // {} () []
lcbr lcbr
@ -126,7 +126,7 @@ pub enum Kind {
const ( const (
assign_tokens = [Kind.assign, .plus_assign, .minus_assign, .mult_assign, assign_tokens = [Kind.assign, .plus_assign, .minus_assign, .mult_assign,
.div_assign, .xor_assign, .mod_assign, .or_assign, .and_assign, .div_assign, .xor_assign, .mod_assign, .or_assign, .and_assign,
.righ_shift_assign, .left_shift_assign] .right_shift_assign, .left_shift_assign]
nr_tokens = 141 nr_tokens = 141
) )
// build_keys genereates a map with keywords' string values: // build_keys genereates a map with keywords' string values:
@ -183,7 +183,7 @@ fn build_token_str() []string {
s[Kind.mod_assign] = '%=' s[Kind.mod_assign] = '%='
s[Kind.or_assign] = '|=' s[Kind.or_assign] = '|='
s[Kind.and_assign] = '&=' s[Kind.and_assign] = '&='
s[Kind.righ_shift_assign] = '>>=' s[Kind.right_shift_assign] = '>>='
s[Kind.left_shift_assign] = '<<=' s[Kind.left_shift_assign] = '<<='
s[Kind.lcbr] = '{' s[Kind.lcbr] = '{'
s[Kind.rcbr] = '}' s[Kind.rcbr] = '}'
@ -397,7 +397,7 @@ pub fn (tok Token) precedence() int {
// .logical_or, // .logical_or,
.assign, .plus_assign, .minus_assign, .div_assign, .mod_assign, .or_assign, .assign, .plus_assign, .minus_assign, .div_assign, .mod_assign, .or_assign,
// //
.left_shift_assign, .righ_shift_assign, .mult_assign { .left_shift_assign, .right_shift_assign, .mult_assign {
return int(Precedence.assign) return int(Precedence.assign)
} }
.key_in, .key_as { .key_in, .key_as {
@ -460,7 +460,7 @@ pub fn (tok Token) is_right_assoc() bool {
// `=` | `+=` | `-=` | `*=` | `/=` // `=` | `+=` | `-=` | `*=` | `/=`
.assign, .plus_assign, .minus_assign, .mult_assign, .div_assign, .assign, .plus_assign, .minus_assign, .mult_assign, .div_assign,
// `%=` | `>>=` | `<<=` // `%=` | `>>=` | `<<=`
.mod_assign, .righ_shift_assign, .left_shift_assign, .mod_assign, .right_shift_assign, .left_shift_assign,
// `&=` | `^=` | `|=` // `&=` | `^=` | `|=`
.and_assign, .xor_assign, .or_assign] .and_assign, .xor_assign, .or_assign]
} }