cgen: add "case" to c_reserved

pull/8650/head
Alexander Medvednikov 2021-02-09 03:49:19 +01:00
parent 1a2ae0aead
commit bfee8a528c
1 changed files with 5 additions and 3 deletions

View File

@ -15,9 +15,11 @@ import v.depgraph
// NB: keywords after 'new' are reserved in C++
const (
c_reserved = ['delete', 'exit', 'link', 'unix', 'error', 'calloc', 'malloc', 'free', 'panic',
'auto', 'char', 'default', 'do', 'double', 'extern', 'float', 'inline', 'int', 'long',
'register', 'restrict', 'short', 'signed', 'sizeof', 'static', 'switch', 'typedef', 'union',
'unsigned', 'void', 'volatile', 'while', 'new', 'namespace', 'class', 'typename', 'export']
'case', 'auto', 'char', 'default', 'do', 'double', 'extern', 'float', 'inline', 'int',
'long', 'register', 'restrict', 'short', 'signed', 'sizeof', 'static', 'switch', 'typedef',
'union', 'unsigned', 'void', 'volatile', 'while', 'new', 'namespace', 'class', 'typename',
'export',
]
// same order as in token.Kind
cmp_str = ['eq', 'ne', 'gt', 'lt', 'ge', 'le']
// when operands are switched