Skip to content

Commit

Permalink
fix: annotation offset for @export keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
lihebi committed Dec 21, 2022
1 parent 5d4cc5c commit 0f77926
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/src/lib/parser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function analyzeCodeViaQuery(code) {
let ispublic = false;
if (code.trim().startsWith("@export")) {
ispublic = true;
code = code.slice(7).trim();
code = code.replace("@export", " ".repeat("@export".length));
}
// magic commands
if (code.startsWith("!")) return { ispublic, annotations };
Expand Down Expand Up @@ -99,7 +99,7 @@ export function analyzeCode(code) {
let ispublic = false;
if (code.trim().startsWith("@export")) {
ispublic = true;
code = code.slice(7).trim();
code = code.replace("@export", " ".repeat("@export".length));
}
// magic commands
if (code.startsWith("!")) return { ispublic, annotations };
Expand Down
2 changes: 1 addition & 1 deletion ui/src/lib/runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function rewriteCode(id: string, get: () => RepoSlice & RuntimeSlice) {
let pod = pods[id];
let code = pod.content;
if (code.trim().startsWith("@export")) {
code = code.slice(7).trim();
code = code.replace("@export", " ".repeat("@export".length));
}
if (code.startsWith("!")) return code;
// replace with symbol table
Expand Down

0 comments on commit 0f77926

Please sign in to comment.