projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
index: announcements
[lambda.git]
/
code
/
tokens.js
diff --git
a/code/tokens.js
b/code/tokens.js
index
53639a8
..
921040d
100644
(file)
--- a/
code/tokens.js
+++ b/
code/tokens.js
@@
-81,16
+81,17
@@
String.prototype.tokens = function (prefix, suffix) {
for (;;) {
c = this.charAt(i);
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
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;
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') ||
// 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");
str += c;
i += 1;
make('name', str).error("Bad identifier");