raiseException('#ifndef found, #if !defined is preferred')
defcheckLongLongConstants(lines,idx,filename):
line=lines[idx]
ifnot'LL'inline:
return
forminre.finditer(re_longlong_constant_hex,line):
raiseException('plain longlong constant, use DUK_U64_CONSTANT or DUK_I64_CONSTANT: '+str(m.group(0)))
forminre.finditer(re_longlong_constant_dec,line):
raiseException('plain longlong constant, use DUK_U64_CONSTANT or DUK_I64_CONSTANT: '+str(m.group(0)))
defcheckCppComment(lines,idx,filename):
line=lines[idx]
m=re_cpp_comment.match(line)
@ -419,6 +431,7 @@ def main():
parser.add_option('--check-nonleading-tab',dest='check_nonleading_tab',action='store_true',default=False,help='Check for non-leading tab characters')
parser.add_option('--check-cpp-comment',dest='check_cpp_comment',action='store_true',default=False,help='Check for c++ comments ("// ...")')
parser.add_option('--check-ifdef-ifndef',dest='check_ifdef_ifndef',action='store_true',default=False,help='Check for #ifdef and #ifndef (prefer #if defined and #if !defined)')
parser.add_option('--check-longlong-constants',dest='check_longlong_constants',action='store_true',default=False,help='Check for plain 123LL or 123ULL constants')
parser.add_option('--fail-on-errors',dest='fail_on_errors',action='store_true',default=False,help='Fail on errors (exit code != 0)')