From 0f3accb12d7179653e31890fe4e26682815cc3a7 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Thu, 20 Nov 2014 19:45:43 +0100
Subject: [PATCH 1/3] dsm: another way for writing comments: lines starting
 with # (hash)

---
 apps/dsm/DSMStateDiagramCollection.cpp | 6 +++---
 doc/dsm/dsm_syntax.txt                 | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/apps/dsm/DSMStateDiagramCollection.cpp b/apps/dsm/DSMStateDiagramCollection.cpp
index 79c5ff0..749d223 100644
--- a/apps/dsm/DSMStateDiagramCollection.cpp
+++ b/apps/dsm/DSMStateDiagramCollection.cpp
@@ -50,11 +50,11 @@ bool DSMStateDiagramCollection::readFile(const string& filename, const string& n
   while (ifs.good() && !ifs.eof()) {
     string r;
     getline(ifs, r);
-    // skip comments
+    // skip comments: lines starting with -- or #
     size_t fpos  = r.find_first_not_of(" \t");
     if (fpos != string::npos) {
-      if (r.length() > fpos+1 &&
-	  r.substr(fpos, 2) == "--")
+      if ((r.length() > fpos+1 && r.substr(fpos, 2) == "--") ||
+	  ((r.length() >= fpos+1 && r.substr(fpos, 1) == "#" && r.substr(fpos, 8) != "#include") ))
 	continue;
 
       if (r.length() > fpos+1 && 
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index 3a4019e..cf29e6e 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -4,6 +4,8 @@ DSM quick reference
 Syntax
 ======
 -- comment
+# also comment
+
 #include "script.dsm"
 #include "/path/to/anotherscript.dsm"
 import(mod_name);
-- 
1.9.3 (Apple Git-50)

