diff --git a/grammar/concepts.grammar b/grammar/concepts.grammar index 6796606a7..8c81ea309 100644 --- a/grammar/concepts.grammar +++ b/grammar/concepts.grammar @@ -10,7 +10,7 @@ loadConceptsParser const path = require("path") const {file} = this.parent const folder = path.join(file.folderPath, this.getWord(1)) - const ONE_BIG_FILE = Disk.getFiles(folder).filter(file => file.endsWith(".scroll")).map(fullPath => Disk.read(fullPath)).join("\n\n").replace(/import .+/g, "") + const ONE_BIG_FILE = Disk.getFiles(folder).filter(file => file.endsWith(".scroll")).map(fullPath => Disk.read(fullPath) + `\nfilename ${path.basename(fullPath)}\n`).join("\n\n").replace(/import .+/g, "") this.parent.concat(ONE_BIG_FILE) //console.log(ONE_BIG_FILE) return "" diff --git a/grammar/measures.grammar b/grammar/measures.grammar index 3a444fba9..9c355f892 100644 --- a/grammar/measures.grammar +++ b/grammar/measures.grammar @@ -67,6 +67,17 @@ idParser extends abstractStringMeasureParser int sortIndex 0 +filenameParser + // Added by the loadConcepts keyword + description What is the name of the file holding this concept? + extends abstractStringMeasureParser + boolean isComputed true + int sortIndex 1 + javascript + computeValue(concept, measureName, parsedProgram) { + return concept.get("filename") || parsedProgram.file.filename + } + // Numeric Measures abstractNumericMeasureParser string typeForCsvDocs number diff --git a/package.json b/package.json index 83d9bd073..d2f51bc34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scroll-cli", - "version": "85.3.0", + "version": "85.4.0", "description": "A language for bloggers. A curated collection of tools for thoughts.", "main": "scroll.js", "engines": { diff --git a/releaseNotes.scroll b/releaseNotes.scroll index cb3ced273..a6101754b 100644 --- a/releaseNotes.scroll +++ b/releaseNotes.scroll @@ -4,6 +4,9 @@ title Scroll Release Notes thinColumns +# 85.4.0 5/10/2024 +- 🎉 Scroll now auto-adds a "filename" measure as to which file the concept appears in. + # 85.3.0 5/10/2024 - 🎉 Scroll now only wraps compiler output with html tags if permalink ends in "html" or "htm". Makes it easier to use Scroll to compile files to different language targets.