Skip to content
Permalink
Browse files

allow comments inside cubescript lists

like this:
  alias listwiththreeelements [
    first   // first element
    second  // second element
    third   // third element
  ]

"echo $listwiththreeelements" will print everything, including comments,
but "echo (listlen $listwiththreeelements)" will print "3", and
"echo (at $listwiththreeelements 1)" will print "second".
  • Loading branch information...
ac-stef committed Mar 23, 2015
1 parent 82f0f4e commit 7b607a6c437ecf6d4d83b85899a81e70493e525a
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/src/command.cpp
@@ -1125,7 +1125,7 @@ void format(char **args, int numargs)
result(s.getbuf());
}

#define whitespaceskip s += strspn(s, "\n\t \r")
#define whitespaceskip do { s += strspn(s, "\n\t \r"); } while(s[0] == '/' && s[1] == '/' && (s += strcspn(s, "\n\0")))
#define elementskip { if(*s=='"') { do { ++s; s += strcspn(s, "\"\n"); } while(*s == '\"' && s[-1] == '\\'); s += *s=='"'; } else s += strcspn(s, "\n\t "); }

void explodelist(const char *s, vector<char *> &elems)

0 comments on commit 7b607a6

Please sign in to comment.
You can’t perform that action at this time.