Skip to content

Commit

Permalink
Body order fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
esseswann committed Sep 30, 2023
1 parent 331ca5b commit 114e41b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/metadata/compileTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const compileTemplates = (
const compiled = compileTemplate(templates, new Set(path), match[1])
if (compiled) {
result.declares = mergeDeclares(result.declares, compiled.declares)
result.body += compiled.body
result.body = compiled.body + result.body
}
}
return result
Expand Down
3 changes: 1 addition & 2 deletions src/metadata/templateSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import cleanQuery from './cleanQuery'

export const extractSections = (view: string): TemplateSections => {
const declaresRegex =
/declare \$(?<varName>[\w\d]+) as (?<type>[\w\d]+)( = (?<defaultValue>[\w\d]+))?;\s*/g
/declare \$(?<varName>[\w\d]+) as (?<type>[\w\d]+)( = (?<defaultValue>[\w\d]+));?\s*/g

const declares = new Map<string, Declare>()
let match
Expand All @@ -29,7 +29,6 @@ export const mergeDeclares = (left: Declares, right: Declares) => {

export const compileDeclares = (declares: Declares) => {
let result = ''
console.log('comipleDeclares', declares)
for (const declare of declares) result += compileDeclare(declare)
return result
}
Expand Down

0 comments on commit 114e41b

Please sign in to comment.