From 7e8801fa55c96d1a4a9bdce1069faab72fc9b84a Mon Sep 17 00:00:00 2001
From: Vasileios Karakasis <karakasis@cscs.ch>
Date: Fri, 7 Oct 2016 15:16:16 +0200
Subject: [PATCH] Support for comments starting with '?'

---
 data/test.mod   | 3 ++-
 modcc/lexer.cpp | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/data/test.mod b/data/test.mod
index 9ab78685..d7403c79 100644
--- a/data/test.mod
+++ b/data/test.mod
@@ -1,4 +1,5 @@
 : sample file
+? another style of comments
 
 NEURON  {
     THREADSAFE
@@ -26,7 +27,7 @@ PARAMETER {
     gkbar   = 0.1  (mho/cm2)
     celsius
     ek      = -100 (mV)    : must be explicitly def. in hoc
-    v       (mV)
+    v       (mV)           ? another style of comment
     vhalfm  =-43   (mV)
     km      =8
     vhalfh  =-67   (mV)
diff --git a/modcc/lexer.cpp b/modcc/lexer.cpp
index b4b8ccf9..ea371d10 100644
--- a/modcc/lexer.cpp
+++ b/modcc/lexer.cpp
@@ -78,8 +78,9 @@ Token Lexer::parse() {
                 location_.line++;
                 continue;   // skip to next line
 
-            // comment (everything after : on a line is a comment)
-            case ':'    :
+            // comment (everything after : or ? on a line is a comment)
+            case ':' :
+            case '?' :
                 // strip characters until either end of file or end of line
                 while( !is_eof(*current_) && *current_ != '\n') {
                     ++current_;
-- 
GitLab