mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: add all C reserved words to CReserved
This commit is contained in:
parent
d88315d789
commit
99c9410cc2
@ -124,7 +124,7 @@ fn (p mut Parser) select_query(fn_ph int) string {
|
||||
for i, field in fields {
|
||||
mut cast := ''
|
||||
if field.typ == 'int' {
|
||||
cast = 'string_int'
|
||||
cast = 'v_string_int'
|
||||
}
|
||||
obj_gen.writeln('${qprefix}$tmp . $field.name = $cast( *(string*)array__get(${qprefix}row.vals, $i) );')
|
||||
}
|
||||
|
@ -102,10 +102,44 @@ const (
|
||||
'error',
|
||||
'malloc',
|
||||
'calloc',
|
||||
'char',
|
||||
'free',
|
||||
'panic',
|
||||
'register'
|
||||
|
||||
// Full list of C reserved words, from: https://en.cppreference.com/w/c/keyword
|
||||
'auto',
|
||||
'break',
|
||||
'case',
|
||||
'char',
|
||||
'const',
|
||||
'continue',
|
||||
'default',
|
||||
'do',
|
||||
'double',
|
||||
'else',
|
||||
'enum',
|
||||
'extern',
|
||||
'float',
|
||||
'for',
|
||||
'goto',
|
||||
'if',
|
||||
'inline',
|
||||
'int',
|
||||
'long',
|
||||
'register',
|
||||
'restrict',
|
||||
'return',
|
||||
'short',
|
||||
'signed',
|
||||
'sizeof',
|
||||
'static',
|
||||
'struct',
|
||||
'switch',
|
||||
'typedef',
|
||||
'union',
|
||||
'unsigned',
|
||||
'void',
|
||||
'volatile',
|
||||
'while',
|
||||
]
|
||||
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user