Problem: objc file detected as Octave. (Antony Lee)
Solution: Detect objc by preprocessor lines. (Doug Kearns, closes #9223,
closes #9220)
" excluding end(for|function|if|switch|while) common to Murphi
let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
+ let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>'
+
let n = 1
let saw_comment = 0 " Whether we've seen a multiline comment leader.
while n < 100
" anything more definitive.
let saw_comment = 1
endif
- if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
+ if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor
setf objc
return
endif
call assert_equal('objc', &filetype)
bwipe!
+ call writefile(['#include <header.h>'], 'Xfile.m')
+ split Xfile.m
+ call assert_equal('objc', &filetype)
+ bwipe!
+
+ call writefile(['#define FORTY_TWO'], 'Xfile.m')
+ split Xfile.m
+ call assert_equal('objc', &filetype)
+ bwipe!
+
" Octave
call writefile(['# Octave line comment'], 'Xfile.m')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3679,
/**/
3678,
/**/