Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Sep 25, 2024
1 parent ac972dd commit be33155
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "133.4.0",
"version": "133.5.0",
"description": "A language for scientists of all ages. A curated collection of tools for refining and sharing thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
21 changes: 21 additions & 0 deletions parsers/tables.parsers
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,27 @@ scrollReverseParser
return this.parent.coreTable.slice().reverse()
}

scrollComposeParser
extends abstractTableTransformParser
description Add column using format string.
crux compose
javascript
get coreTable() {
const {newColumnName} = this
const formatString = this.getAtomsFrom(2).join(" ")
return this.parent.coreTable.map(row => {
const newRow = Object.assign({}, row)
newRow[newColumnName] = new Particle(row).evalTemplateString(formatString)
return newRow
})
}
get newColumnName() {
return this.atoms[1]
}
get columnNames() {
return this.parent.columnNames.concat(this.newColumnName)
}

scrollLimitParser
extends abstractTableTransformParser
description Select a subset.
Expand Down
3 changes: 3 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ciBadges.scroll
br
thinColumns

πŸ“¦ 133.5.0 9/24/2024
πŸŽ‰ added `compose` parser to tables

πŸ“¦ 133.4.0 9/24/2024
πŸŽ‰ added `quickIncludeJsonParser` parser

Expand Down
2 changes: 2 additions & 0 deletions tests/tables.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ table

table
printTable
compose statement The name of the folder is {folder}
printTable
data
folder ctime
adfs 1726005360192
Expand Down

0 comments on commit be33155

Please sign in to comment.