|
@@ -30,7 +30,11 @@ const propertiesDict = h.getPropertyRules(special_properties);
|
|
|
const slash = P.MonadicParser.string('/');
|
|
|
const dot = P.MonadicParser.string('.');
|
|
|
const colon = P.MonadicParser.string(':');
|
|
|
+const comma = P.MonadicParser.string(',');
|
|
|
const star = P.MonadicParser.string('*');
|
|
|
+const bra = P.MonadicParser.string('[');
|
|
|
+const ket = P.MonadicParser.string(']');
|
|
|
+const numbers = P.MonadicParser.regexp(/[0-9]/);
|
|
|
|
|
|
|
|
|
function orNull(rule: P.MonadicParser<any>) {
|
|
@@ -164,7 +168,20 @@ const lang = P.MonadicParser.createLanguage({
|
|
|
Expression: function (r: any) {
|
|
|
return P.MonadicParser.alt(
|
|
|
|
|
|
+
|
|
|
r.AtomSelectionMacro.map(atomSelectionQuery2),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
);
|
|
|
},
|
|
|
|
|
@@ -197,12 +214,13 @@ const lang = P.MonadicParser.createLanguage({
|
|
|
orNull(propertiesDict.name).skip(dot)
|
|
|
).map(x => { return {name: x[0] }; }),
|
|
|
)),
|
|
|
- P.MonadicParser.alt(
|
|
|
- P.MonadicParser.seq(
|
|
|
- orNull(propertiesDict.resi),
|
|
|
- ).map(x => { return { resi: x[0]}; }),
|
|
|
- ),
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
P.MonadicParser.alt(
|
|
|
P.MonadicParser.seq(
|
|
|
orNull(propertiesDict.resn).skip(colon),
|
|
@@ -226,12 +244,22 @@ const lang = P.MonadicParser.createLanguage({
|
|
|
orNull(propertiesDict.resn).skip(dot),
|
|
|
orNull(propertiesDict.name),
|
|
|
).map(x => { return { resn: x[0], name: x[1] }; }),
|
|
|
+ P.MonadicParser.seq(
|
|
|
+ orNull(propertiesDict.resn),
|
|
|
+ ).map(x => { return { resn: x[0] };}),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ AtomSelectionMacroResi: function (r: any) {
|
|
|
+ return P.MonadicParser.alt(
|
|
|
+ P.MonadicParser.alt(
|
|
|
P.MonadicParser.seq(
|
|
|
- orNull(propertiesDict.resn)
|
|
|
- ).map(x => { return { resn: x[0] };}),
|
|
|
+ orNull(propertiesDict.resi)
|
|
|
+ ).map(x => { return { resi: x[0] };}),
|
|
|
),
|
|
|
);
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
ObjectProperty: () => {
|
|
|
const w = h.getReservedWords(special_properties, special_keywords, special_operators)
|
|
@@ -264,7 +292,7 @@ const lang = P.MonadicParser.createLanguage({
|
|
|
P.MonadicParser.alt(
|
|
|
r.ValueRange,
|
|
|
r.Value
|
|
|
- ).sepBy1(P.MonadicParser.comma)
|
|
|
+ ).sepBy1(comma)
|
|
|
).map(x => {
|
|
|
const [property, values] = x;
|
|
|
const listValues: (string | number)[] = [];
|