[anjuta] mk-project: Ignore conditional directives in makefile



commit 6a5ea6e049d0711254c417e67c6023ec77121495
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sun Apr 14 16:59:15 2013 +0200

    mk-project: Ignore conditional directives in makefile

 plugins/mk-project/mk-parser.y  | 13 +++++++++++++
 plugins/mk-project/mk-scanner.l |  8 +++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/plugins/mk-project/mk-parser.y b/plugins/mk-project/mk-parser.y
index 1c087fa..52dd83b 100644
--- a/plugins/mk-project/mk-parser.y
+++ b/plugins/mk-project/mk-parser.y
@@ -62,6 +62,9 @@
 %token  _SILENT
 %token  _EXPORT_ALL_VARIABLES
 %token  _NOTPARALLEL
+%token IFEQ
+%token ELSE
+%token ENDIF
 
 %defines
 
@@ -177,6 +180,7 @@ statement:
     end_of_line
     | space end_of_line
     | definition end_of_line
+    | conditional end_of_line
     | rule  command_list {
         anjuta_token_merge_children ($1, $2);
         mkp_scanner_add_rule (scanner, $1);
@@ -244,6 +248,12 @@ command_list:
     }
        ;
 
+conditional:
+    IFEQ value
+    | ELSE
+    | ENDIF
+    ;  
+
 
 /* Lists
  *----------------------------------------------------------------------------*/
@@ -503,6 +513,9 @@ word_token:
     | _SILENT
     | _EXPORT_ALL_VARIABLES
     | _NOTPARALLEL
+    | IFEQ
+    | ELSE
+    | ENDIF
     ;
                
 space_token:
diff --git a/plugins/mk-project/mk-scanner.l b/plugins/mk-project/mk-scanner.l
index 873dbde..7346b25 100644
--- a/plugins/mk-project/mk-scanner.l
+++ b/plugins/mk-project/mk-scanner.l
@@ -137,7 +137,13 @@ NAME          [^ \t\n\r:#=$"'`&@\\]*
 
 .NOTPARALLEL                { RETURN (_NOTPARALLEL); }
 
-{NAME}                      { RETURN (NAME);}
+ifeq                        { RETURN (IFEQ); }
+
+else                        { RETURN (ELSE); }
+
+endif                       { RETURN (ENDIF); }
+
+{NAME}                      { RETURN (NAME); }
 
 .                           { RETURN (CHARACTER); }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]