]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Adds debug support source files
authorCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 30 Aug 2009 18:07:51 +0000 (19:07 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 30 Aug 2009 18:07:51 +0000 (19:07 +0100)
src/plugins/splash/script/script-debug.c [new file with mode: 0644]
src/plugins/splash/script/script-debug.h [new file with mode: 0644]
src/plugins/splash/script/script-parse.c
src/plugins/splash/script/script-scan.c
src/plugins/splash/script/script-scan.h

diff --git a/src/plugins/splash/script/script-debug.c b/src/plugins/splash/script/script-debug.c
new file mode 100644 (file)
index 0000000..9e9ef57
--- /dev/null
@@ -0,0 +1,22 @@
+/* script-debug.h - Debug handling matching memory loaded data to source locations
+ *
+ * Copyright (C) 2009 Charlie Brej <cbrej@cs.man.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: Charlie Brej <cbrej@cs.man.ac.uk>
+ */
+#include "script-debug.h"
diff --git a/src/plugins/splash/script/script-debug.h b/src/plugins/splash/script/script-debug.h
new file mode 100644 (file)
index 0000000..8b6a41e
--- /dev/null
@@ -0,0 +1,33 @@
+/* script-debug.h - Debug handling matching memory loaded data to source locations
+ *
+ * Copyright (C) 2009 Charlie Brej <cbrej@cs.man.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: Charlie Brej <cbrej@cs.man.ac.uk>
+ */
+#ifndef SCRIPT_DEBUG_H
+#define SCRIPT_DEBUG_H
+
+
+typedef struct
+{
+  int line_index;
+  int column_index;
+} script_debug_source_location_t;
+
+
+#endif /* SCRIPT_DEBUG_H */
index b409659d3ec546fc41f59f2b35d75b63bf9c1c5a..08146ea58c1ae0ca3f73c4a4c3b0fcf4a42f9576 100644 (file)
@@ -150,8 +150,8 @@ static void script_parse_error (script_scan_token_t *token,
                                 const char       *expected)
 {
   ply_error ("Parser error L:%d C:%d : %s\n",
-             token->line_index,
-             token->column_index,
+             token->location.line_index,
+             token->location.column_index,
              expected);
 }
 
@@ -628,7 +628,7 @@ static script_op_t *script_parse_for (script_scan_t *scan)
   ply_list_append_data (op_list, op_first);
   ply_list_append_data (op_list, op_for);
 
-  script_op_t *op_block = script_parse_new_op_block (op_list)
+  script_op_t *op_block = script_parse_new_op_block (op_list);
 
   return op_block;
 }
@@ -721,7 +721,7 @@ static script_op_t *script_parse_op (script_scan_t *scan)
     curtoken = script_scan_get_next_token (scan);
 #endif
 
-    script_op_t *op = script_parse_new_op_exp (exp)
+    script_op_t *op = script_parse_new_op_exp (exp);
     return op;
   }
   return NULL;
index 7c59c385439f16c8b05e07730904f59c25e3fd23..114d0e76dee1159781e88430307570671e3dd61f 100644 (file)
@@ -171,8 +171,8 @@ void script_scan_read_next_token (script_scan_t       *scan,
         }
       break;
     }
-  token->line_index = scan->line_index;
-  token->column_index = scan->column_index;
+  token->location.line_index = scan->line_index;
+  token->location.column_index = scan->column_index;
   nextchar = script_scan_get_next_char (scan);
 
   if (ply_bitarray_lookup (scan->identifier_1st_char, curchar))
index 971292f189ec9ba422c95f966a3ffa0974f08f73..0b23b015bed3632c264dd274b94f8c695a2b3b6f 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef script_scan_H
 #define script_scan_H
 
+#include "script-debug.h"
 #include "ply-bitarray.h"
 #include <stdbool.h>
 
@@ -49,8 +50,7 @@ typedef struct
     double floatpoint;
   } data;
   int whitespace;
-  int line_index;
-  int column_index;
+  script_debug_source_location_t location;
 } script_scan_token_t;
 
 typedef struct