aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPEditorTokens.l
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-13 14:09:56 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-13 14:09:56 +0000
commit072855c944fb56266961ad5ec61349cd38e4acff (patch)
tree2f720fe543d0c351d9501c419724d8acc04709c4 /Source/SPEditorTokens.l
parent4f2b28e1691c5b64e1768ba7c4797623f61cf0a6 (diff)
downloadsequelpro-072855c944fb56266961ad5ec61349cd38e4acff.tar.gz
sequelpro-072855c944fb56266961ad5ec61349cd38e4acff.tar.bz2
sequelpro-072855c944fb56266961ad5ec61349cd38e4acff.zip
• improved text macro snippet behaviour
• improved the ability to run bash commands inside of snippets • ignore most of the syntax highlighting inside snippet declarations • fixed issue in CMTextView to use obj class variables only to generalise this object
Diffstat (limited to 'Source/SPEditorTokens.l')
-rw-r--r--Source/SPEditorTokens.l20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/SPEditorTokens.l b/Source/SPEditorTokens.l
index b3daa531..b0c2dee3 100644
--- a/Source/SPEditorTokens.l
+++ b/Source/SPEditorTokens.l
@@ -61,24 +61,32 @@ keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BIN
%x comment
+%x snippet
%x equation
%x varequation
%%
+
+
+\$\{1?[0-9]: { BEGIN(snippet); return SPT_OTHER; }
+<snippet>\\\} { return SPT_OTHER; }
+<snippet>\} { BEGIN(INITIAL); return SPT_OTHER; }
+
+
\"([^"\\]|\\(.|[\n\r]))*\"? { return SPT_DOUBLE_QUOTED_TEXT; } /* double quoted strings */
'([^'\\]|\\(.|[\n\r]))*'? { return SPT_SINGLE_QUOTED_TEXT; } /* single quoted strings */
-`[^`]*`? { return SPT_BACKTICK_QUOTED_TEXT; } /* backtick quoted string */
+`[^`]*`? { return SPT_BACKTICK_QUOTED_TEXT; } /* backtick quoted string */
-"/*" { BEGIN(comment); return SPT_COMMENT; } /* beginning of a c style comment */
-<comment>[^*]* { return SPT_COMMENT; } /* anything except * in a c cmnt */
-<comment>"*"+ { return SPT_COMMENT; } /* a range of * */
-<comment>"*"+"/" { BEGIN(INITIAL); return SPT_COMMENT; } /* a range of * with trailing /
+"/*" { BEGIN(comment); return SPT_COMMENT; } /* beginning of a c style comment */
+<comment>[^*]* { return SPT_COMMENT; } /* anything except * in a c cmnt */
+<comment>"*"+ { return SPT_COMMENT; } /* a range of * */
+<comment>"*"+"/" { BEGIN(INITIAL); return SPT_COMMENT; } /* a range of * with trailing /
Thanks to John Dickinson for publishing
this method of parsing C comments on
http://www.stillhq.com/pdfdb/000561/data.pdf
*/
#[^\n\r]*(\n|\r)? | /* # Comments */
---[ \t][^\n\r]*(\n|\r)? { return SPT_COMMENT; } /* -- Comments */
+--[ \t][^\n\r]*(\n|\r)? { return SPT_COMMENT; } /* -- Comments */
{variable}/{ops} { BEGIN(varequation); return SPT_VARIABLE; }/* SQL variables before operator*/
<varequation>{ops} { BEGIN(INITIAL); return SPT_OTHER; }