From 189ae5cbb1f64ad40c6055bede4079dca95bdbe8 Mon Sep 17 00:00:00 2001 From: Alex Gordon Date: Tue, 30 Dec 2008 11:01:58 +0000 Subject: [PATCH] Committing from the right repository this time... --- .DS_Store | Bin 0 -> 6148 bytes CodeSenseLibraries/C.xml | 74 ++++ CodeSenseProviders/C.xml | 27 ++ Contents/.DS_Store | Bin 0 -> 6148 bytes Contents/Info.plist | 22 + Contents/Resources/.DS_Store | Bin 0 -> 6148 bytes .../Resources/English.lproj/InfoPlist.strings | Bin 0 -> 92 bytes Contents/Resources/Languages.xml | 16 + "Icon\r" | 0 Itemizers/C.xml | 55 +++ Languages.xml | 15 + Syntaxes/.DS_Store | Bin 0 -> 6148 bytes Syntaxes/C XML.xml | 413 ++++++++++++++++++ TestFile.c | 54 +++ regex.re | 20 + 15 files changed, 696 insertions(+) create mode 100644 .DS_Store create mode 100644 CodeSenseLibraries/C.xml create mode 100644 CodeSenseProviders/C.xml create mode 100644 Contents/.DS_Store create mode 100644 Contents/Info.plist create mode 100644 Contents/Resources/.DS_Store create mode 100644 Contents/Resources/English.lproj/InfoPlist.strings create mode 100644 Contents/Resources/Languages.xml create mode 100644 "Icon\r" create mode 100644 Itemizers/C.xml create mode 100644 Languages.xml create mode 100644 Syntaxes/.DS_Store create mode 100644 Syntaxes/C XML.xml create mode 100644 TestFile.c create mode 100644 regex.re diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8374bceb89ddc5d7bfbc6e147b3fe253509a9c36 GIT binary patch literal 6148 zcmeHKOHRWu5PeQ6QHq2LE0z&U7KqOUB7PDQ3j`N{wtRxpMoORs7AOZ`!#&t=1+Kwm zcw?I?A*tFGLg10c&-Hxld9CdlfZDn1Z31loO{!p{#imBYE?N=Kjw}(C&T)zh43M!s zs(8Br$ADwtw=p1lcNx1#(BrNx?%xOxzl~>v zUdvyPx`Uw{6|?8aMsYH@qW{P2F~jTZI!SpZJxz!?W>E=-EKG_{%f&S{8w1?ZByFkk zMI10PMW4jnYL^rzxIvB9|5}uP^oJzoaC17l(wa#25 z*xSaI|K09j>dGpOv+gzugPD;gJ$6z_uosb7>f(SnfL0i&aD*|RO3Hhj(oc{ z_OHcw@3gl|i3PWuF+zgmXNwexb$Opb3Z4Gc%8!S=kqg(zA0s(C$#7LDxD4 z90O$reDkp__y7Ln_kTIaeR2#q2L2QSsdI>gXoZjd7s_eVg};2Oukk23HH`$wuV literal 0 HcmV?d00001 diff --git a/CodeSenseLibraries/C.xml b/CodeSenseLibraries/C.xml new file mode 100644 index 0000000..322de8c --- /dev/null +++ b/CodeSenseLibraries/C.xml @@ -0,0 +1,74 @@ + + + + + + + + + + .* + + + #0( ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CodeSenseProviders/C.xml b/CodeSenseProviders/C.xml new file mode 100644 index 0000000..643383c --- /dev/null +++ b/CodeSenseProviders/C.xml @@ -0,0 +1,27 @@ + + + + + + c + net.fileability.c.preprocessor + (\s*)#([a-zA-Z0-9-]+) + + + + c + net.fileability.c.keyword + \b([a-zA-Z_]+) + + + c + net.fileability.c.storage.type + \b([a-zA-Z_]+) + + + + diff --git a/Contents/.DS_Store b/Contents/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c07ac1b967871b7aae207f9d855b03e515e84b37 GIT binary patch literal 6148 zcmeHKJ8nWT5S&dYh-fHN`U<&$g~$cq0#Set=}AHKugbY{w9I}A&`UaK(5$o`d%a`J zQ@ni(z*gt|8?Xd0r#s@?hpG9#`^26qVnjO6IO7XD9B|s7CfR=nocn@}b1+=;cgN3R zIQq6s3P=GdAO)m=6u6-RRb1zb8=k47q<|E73I(2Zv|@h%<)6IFDX} z*gQb&g<~QkG)pQmsa7q9C7tnBdA)EA4pEMYQI5Ira{L-e bnb&;I{a!dG2A%Ps6ZJFTy2zx!y%qQcBVZMt literal 0 HcmV?d00001 diff --git a/Contents/Info.plist b/Contents/Info.plist new file mode 100644 index 0000000..5ef8c88 --- /dev/null +++ b/Contents/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + C + CFBundleIdentifier + com.macrabbit.Espresso.Sugar.C + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + C + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/Contents/Resources/.DS_Store b/Contents/Resources/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..01ffa4abea539612d2591322ee76c99d5bd2e2da GIT binary patch literal 6148 zcmeHK%Sr=55Ukc50wUz-alSzC4~CF@fj=M`@WJAW!TX;4E zs3--bz@Y-Cxm|hx-_n1W{|`ypNdYPFuN1Jw=6bW{m8!SSF6X_r(QoKp^FepxIw%a$ lj)~EZx$$;<5k* + + + + + + sourcecode.c + C + + c + h + + + + + diff --git "a/Icon\r" "b/Icon\r" new file mode 100644 index 0000000..e69de29 diff --git a/Itemizers/C.xml b/Itemizers/C.xml new file mode 100644 index 0000000..0f1494e --- /dev/null +++ b/Itemizers/C.xml @@ -0,0 +1,55 @@ + + + + + + + + + + ESBaseItem + preprocessor.c.include > string.quoted > content.include:capture(name) + + + + ESBaseItem + meta.section > meta.preprocessor > pragma-mark:capture(name) + + + + + diff --git a/Languages.xml b/Languages.xml new file mode 100644 index 0000000..2dacfec --- /dev/null +++ b/Languages.xml @@ -0,0 +1,15 @@ + + + + + + + sourcecode.c + C + + c + + + + + diff --git a/Syntaxes/.DS_Store b/Syntaxes/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + + + + + + + + + + + + /\* + + + + \*/ + + + + + + + (//).*$\n? + + + + + + + + \b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|sizeof)\b + + + + + \b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\b + + + + + \b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\b + + + + + \b(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)\b + + + + + \b(const|extern|register|restrict|static|volatile|inline)\b + + + + + + + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b + + + + + \b(NULL|true|false|TRUE|FALSE)\b + + + + + + " + + + + " + + + + + + + + + + + + ' + + + + ' + + + + + + + + + + + + + + \b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\b + + + + + + + + + \; + + + ,[ |\t]* + + + \. + + + \{ + + + \} + +<<<<<<< HEAD:Syntaxes/C XML.xml + + + \[|\] + + + + \s*\((\s*([a-zA-Z0-9_,*\[\]]|\s)*)\)\s* + + + + + + \b[a-zA-Z_][a-zA-Z0-9_]*\b + + + \s* +======= + + \[|\] +>>>>>>> 98d15c4... Added itemizers for blocks and function definitions:Syntaxes/C XML.xml + + + + + + + + + + + + + ^\s*\#\s*(define)\s+((?<id>[a-zA-Z_][a-zA-Z0-9_]*))(?:(\()(\s* \g<id> \s*((,) \s* \g<id> \s*)*(?:\.\.\.)?)(\)))? + + + + + + + + + (?=(?://|/\*))|$ + + + + (?>\\\s*\n) + + + + + + + + + ^\s*#\s*(error|warning)\b + + + + $ + + + + + (?>\\\s*\n) + + + + + + + + ^\s*#\s*(include|import)\b\s+ + + + + (?=(?://|/\*))|$ + + + + + (?>\\\s*\n) + + + (")([^"]*)(") + + + + + + (<)([^>]*)(>) + + + + + + + + + + + + ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef)\b + + + + (?=(?://|/\*))|$ + + + + + (?>\\\s*\n) + + + + + + + + + + + \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2}) + + + \\. + + + + + + + %(\d+\$)?[#0\- +']*[,;:_]?((-?\d+)|\*(-?\d+\$)?)?(\.((-?\d+)|\*(-?\d+\$)?)?)?(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?[diouxXDOUeEfFgGaACcSspn%] + + + + + + % + + + + + + ^\s*(#\s*(pragma\s+mark)\s+(.*)) + + + + + + + + + + ^\s*(#(if)\s+(0)\b).* + + + + + + + ^\s*(#\s*(endif)\b) + + + + + + + + ^\s*(#\s*(else)\b) + + + + + (?=^\s*#\s*endif\b.*$) + + + + + + + + + + + + + (?=^\s*#\s*(else|endif)\b.*$) + + + + + + + + + + + + + ^\s*(#(if)\s+(0*1)\b) + + + + + + ^\s*(#\s*(endif)\b) + + + + + + + + ^\s*(#\s*(else)\b).* + + + + + (?=^\s*#\s*endif\b.*$) + + + + + + + + + + + + + + (?=^\s*#\s*(else|endif)\b.*$) + + + + + + + + + + + + ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$)) + + + + + ^\s*(#\s*(endif)\b).*$ + + + + + + + + + + + \ No newline at end of file diff --git a/TestFile.c b/TestFile.c new file mode 100644 index 0000000..700c210 --- /dev/null +++ b/TestFile.c @@ -0,0 +1,54 @@ +#import +#include "test" +#pragma mark asd +#warning test +#define test(a) a*2 + +#if (x == 1) +#elif (x == 2) +#endif +q +#ifdef test +#endif + +/* + Comment A + Comment B +*/ + +void a(int *mk) { + + +} + +void foo(asd asd) +{ + +} + + + + +//Line comment +{ + +} +if + +42 +10.634 +123e-23 +0x123456 +01234 + +"A string" +"A string with \n newlines and \t tabs" +'b' + +int x = 5; +register uint y = 2; + +bool b = true; + +printf("abc %d", x); +scanf("%u", &y); \ No newline at end of file diff --git a/regex.re b/regex.re new file mode 100644 index 0000000..85d2970 --- /dev/null +++ b/regex.re @@ -0,0 +1,20 @@ +\b + + +(?#Function Name) +([a-zA-Z_][a-zA-Z0-9_]*) +\s* + +(?#Beginning Bracket) +(\() + +(?#Args) +.*? + +(?#End Bracket) +(\)) + +\s* + +(?#Lookarounds) +(?!;)(?:\})