lexer tweak
[lambda.git] / code / tokens.js
index 53639a8..921040d 100644 (file)
@@ -81,16 +81,17 @@ String.prototype.tokens = function (prefix, suffix) {
             for (;;) {
                 c = this.charAt(i);
                 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
-                        (c >= '0' && c <= '9') || c === '_' || c === '-') {
+                        (c >= '0' && c <= '9') || c === '_' || c === '-' || c === '/') {
                     str += c;
                     i += 1;
                                } else if (c === '?' || c === '!') {
                                // should only be terminal
                     str += c;
                     i += 1;
+                                       c = this.charAt(i);
                                // make sure next character is not an identifier
                                        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
-                                               (c >= '0' && c <= '9') || c === '_' || c === '-' || c === '?' || c === '!') {
+                                               (c >= '0' && c <= '9') || c === '_' || c === '-' || c === '/' || c === '?' || c === '!') {
                                                str += c;
                                                i += 1;
                                                make('name', str).error("Bad identifier");