dal-ast-js 0.0.4-dev → 0.0.6-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.esm.js +6 -6
- package/package.json +1 -1
- package/src/Lexer.js +12 -6
- package/tests/designs/reverse_name_persist.dal +2 -2
- package/tests/output/test_tokens.json +526 -533
package/dist/index.cjs
CHANGED
|
@@ -86,7 +86,7 @@ class DalLexer {
|
|
|
86
86
|
const token = this.getToken(character);
|
|
87
87
|
if (token) {
|
|
88
88
|
if (token === "HASH") {
|
|
89
|
-
this.
|
|
89
|
+
this.ignoreComment();
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
this.addAccumulatedIdentifierToken();
|
|
@@ -103,14 +103,14 @@ class DalLexer {
|
|
|
103
103
|
* Scan to new line to ignore comment.
|
|
104
104
|
* @returns {null}
|
|
105
105
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
ignoreComment () {
|
|
107
|
+
while (++this.currPos < this.source.length) {
|
|
108
108
|
const character = this.source[this.currPos];
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
const token = this.getToken(character);
|
|
110
|
+
if (token == "HASH") {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
}
|
|
113
|
+
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -84,7 +84,7 @@ class DalLexer {
|
|
|
84
84
|
const token = this.getToken(character);
|
|
85
85
|
if (token) {
|
|
86
86
|
if (token === "HASH") {
|
|
87
|
-
this.
|
|
87
|
+
this.ignoreComment();
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
this.addAccumulatedIdentifierToken();
|
|
@@ -101,14 +101,14 @@ class DalLexer {
|
|
|
101
101
|
* Scan to new line to ignore comment.
|
|
102
102
|
* @returns {null}
|
|
103
103
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
ignoreComment () {
|
|
105
|
+
while (++this.currPos < this.source.length) {
|
|
106
106
|
const character = this.source[this.currPos];
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
const token = this.getToken(character);
|
|
108
|
+
if (token == "HASH") {
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
}
|
|
111
|
+
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/**
|
package/package.json
CHANGED
package/src/Lexer.js
CHANGED
|
@@ -71,7 +71,7 @@ export class DalLexer {
|
|
|
71
71
|
const token = this.getToken(character);
|
|
72
72
|
if (token) {
|
|
73
73
|
if (token === "HASH") {
|
|
74
|
-
this.
|
|
74
|
+
this.ignoreComment();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
this.addAccumulatedIdentifierToken();
|
|
@@ -88,14 +88,20 @@ export class DalLexer {
|
|
|
88
88
|
* Scan to new line to ignore comment.
|
|
89
89
|
* @returns {null}
|
|
90
90
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
ignoreComment () {
|
|
92
|
+
/**
|
|
93
|
+
* Comments are:
|
|
94
|
+
* # This is a comment #
|
|
95
|
+
*/
|
|
96
|
+
let comment = "";
|
|
97
|
+
while (++this.currPos < this.source.length) {
|
|
93
98
|
const character = this.source[this.currPos];
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
const token = this.getToken(character);
|
|
100
|
+
if (token == "HASH") {
|
|
96
101
|
return;
|
|
97
102
|
}
|
|
98
|
-
|
|
103
|
+
comment += character;
|
|
104
|
+
}
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
design ("reverse_name_persist")
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
behavior b_createDatabaseConnection
|
|
3
|
+
#Example comment that is ignored.#
|
|
4
|
+
behavior b_createDatabaseConnection
|
|
5
5
|
create(name=connection, type="object", role="connection")
|
|
6
6
|
_connectToDatabase(connection)
|
|
7
7
|
set(worldState, ["connection"], connection)
|