Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ref at root level; anonymous section #230

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
timer = setTimeout(() => {
const theme =
localStorage.getItem(`${location.hostname}-zenuml-theme`) ||
"theme-idle-afternoon";
"theme-default";
window.zenUml
.render(cm.getValue(), {
theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ export default {
const atom = computed(() => section.value?.atom()?.getFormattedText());
const blockInSection = computed(() => braceBlock.value?.block());

const label = computed(
() => atom.value ?? capitalize(section.value.SECTION()),
);
const label = computed(() => atom.value ?? capitalize("section"));

return {
label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ describe("MessageLayer", () => {
expect(messageLayerWrapper.find(".pt-24").exists()).toBeTruthy();
});
it("gets participant names", async () => {
expect(messageLayerWrapper.vm.origin).toBeNull();
expect(messageLayerWrapper.vm.origin).toBe("_STARTER_");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ TODO: we may need to consider the width of self message on right most participan
<template>
<div class="message-layer relative z-30 pt-24 pb-10">
<block
v-if="!!origin"
:context="context"
:style="{ 'padding-left': paddingLeft + 'px' }"
:origin="origin"
Expand Down Expand Up @@ -35,7 +34,7 @@ const paddingLeft = computed(() => {

const origin = computed(() => {
const ownableMessages = AllMessages(rootContext.value);
if (ownableMessages.length === 0) return null;
if (ownableMessages.length === 0) return _STARTER_;
return ownableMessages[0].from || _STARTER_;
});

Expand Down
4 changes: 3 additions & 1 deletion src/g4/sequenceParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ critical
| CRITICAL
;

// section(name) {}
section
: SECTION (OPAR atom? CPAR)? braceBlock
| SECTION
| braceBlock // allows anonymous section. This is mostly for error tolerance (e.g. ref(x) { m1 }).
| SECTION // Error tolerance for incomplete section
;

creation
Expand Down
Loading
Loading