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 {
+ } 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 === '!') {
+ str += c;
+ i += 1;
+ make('name', str).error("Bad identifier");
+ }
+ } else {
break;
}
}