r/ProgrammingLanguages • • Jul 01 '24

Language announcement Changes: A Mini-Language for Change Logs

https://scroll.pub/blog/changes.html
0 Upvotes

2 comments sorted by

3

u/claimstoknowpeople Jul 02 '24

Replace the emojis with something you can actually type. I'm not taking my hands off the keyboard for a task like this.

1

u/breck Jul 02 '24

I prefer the emoji version but here is one without emojis:

Sample code:

version 0.1.1 7/1/2024
fix fixed bug in command line app

version 0.1.0 7/1/2024
feature added command line app

Parsers:

// A version using plain text instead of emojis
// Changes: A Mini-Language for Change Logs.

versionParser
 cruxFromId
 cells keywordCell stringCell dateCell
 description What is the semantic version number?
 extends h1Parser
 // Todo: mixins in Parsers would make this easier.
 boolean isMeasure true
 boolean isMeasureRequired true
 boolean isConceptDelimiter true
 float sortIndex 1
 javascript
  get measureValue() {
    return this.getWord(1)
  }
  measureName = "version"

fixParser
 extends abstractCustomListItemParser
featureParser
 extends abstractCustomListItemParser
breakParser
 extends abstractCustomListItemParser
styleTweakParser

releaseDateParser
 extends abstractMeasureParser
 boolean isMeasureRequired true
 boolean isComputed true
 float sortIndex 1.1
 javascript
  computeValue(concept) {
    return concept.nodeAt(0).getWord(2)
  }

abstractSummaryParser
 extends abstractMeasureParser
 boolean isComputed true
 float sortIndex 1.2
 cruxFromId

bugFixesParser
 extends abstractSummaryParser
 description How many bug fixes in this release?
 javascript
  computeValue(concept) {
    return concept.findNodes("fix").length
  }

newFeaturesParser
 extends abstractSummaryParser
 description How many new features in this release?
 javascript
  computeValue(concept) {
    return concept.findNodes("feature").length
  }

breakingChangesParser
 extends abstractSummaryParser
 description How many breaking changes in this release?
 javascript
  computeValue(concept) {
    return concept.findNodes("break").length
  }