Fix syntax highlighting for anonymous asynchronous agents [#57]

This commit is contained in:
David Evans 2019-06-15 23:33:33 +01:00
parent 787f4c5299
commit 57586d5456
5 changed files with 24 additions and 8 deletions

View File

@ -3548,6 +3548,8 @@
'\n': end,
},
},
':': CM_ERROR,
'\n': end,
}},
}),
};
@ -3594,9 +3596,10 @@
});
return Object.assign({
'...': {type: 'operator', then: {
'...': {type: 'operator', then: Object.assign({
'': firstAgentDelayed,
}},
':': CM_ERROR,
}, connectors)},
}, makeOpBlock({
exit: firstAgent,
sourceExit: Object.assign({

File diff suppressed because one or more lines are too long

View File

@ -3548,6 +3548,8 @@
'\n': end,
},
},
':': CM_ERROR,
'\n': end,
}},
}),
};
@ -3594,9 +3596,10 @@
});
return Object.assign({
'...': {type: 'operator', then: {
'...': {type: 'operator', then: Object.assign({
'': firstAgentDelayed,
}},
':': CM_ERROR,
}, connectors)},
}, makeOpBlock({
exit: firstAgent,
sourceExit: Object.assign({

View File

@ -232,6 +232,8 @@ const makeCommands = ((() => {
'\n': end,
},
},
':': CM_ERROR,
'\n': end,
}},
}),
};
@ -278,9 +280,10 @@ const makeCommands = ((() => {
});
return Object.assign({
'...': {type: 'operator', then: {
'...': {type: 'operator', then: Object.assign({
'': firstAgentDelayed,
}},
':': CM_ERROR,
}, connectors)},
}, makeOpBlock({
exit: firstAgent,
sourceExit: Object.assign({

View File

@ -705,7 +705,14 @@ describe('Code Mirror Mode', () => {
cm.getDoc().setValue('A -> ...woo\n... ');
const hints = getHintTexts({ch: 4, line: 1});
expect(hints).toEqual(['woo ']);
expect(hints).toContain('woo ');
});
it('suggests anonymous delayed agents', () => {
cm.getDoc().setValue('A -> ...\n... ');
const hints = getHintTexts({ch: 4, line: 1});
expect(hints).toContain('-> ');
});
it('suggests agent properties', () => {