Skip to content

Commit 8b28db7

Browse files
committed
Console: Generate CSON file from JSON file
1 parent 2b56425 commit 8b28db7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

grammars/julia-console.cson

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
scopeName: 'source.julia.console'
22
name: 'Julia Console'
3-
comment: "Not sure what this will be used for... Maybe if we have a REPL someday"
3+
comment: 'Not sure what this will be used for... Maybe if we have a REPL someday. We do now...'
44
patterns: [
55
{
6-
match: '^(julia>|\\.{3}|In \\[\\d+\\]:) (.+)$'
6+
match: '^(julia>)(\\s+.*(?:\\n\\s{6}\\s+.*)*)'
77
captures:
88
'1':
99
name: 'punctuation.separator.prompt.julia.console'
1010
'2':
1111
patterns: [
12-
include: 'source.julia'
12+
{
13+
include: 'source.julia'
14+
}
1315
]
1416
}
1517
{
@@ -19,7 +21,9 @@ patterns: [
1921
name: 'punctuation.separator.prompt.shell.julia.console'
2022
'2':
2123
patterns: [
22-
include: 'source.shell'
24+
{
25+
include: 'source.shell'
26+
}
2327
]
2428
}
2529
{
@@ -29,7 +33,9 @@ patterns: [
2933
name: 'punctuation.separator.prompt.help.julia.console'
3034
'2':
3135
patterns: [
32-
include: 'source.julia'
36+
{
37+
include: 'source.julia'
38+
}
3339
]
3440
}
35-
]
41+
]

scripts/generate.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ const fs = require('fs')
33
const path = require('path')
44

55
const outdir = path.join(__dirname, '..', 'grammars')
6+
7+
const consoleGrammar = JSON.parse(fs.readFileSync(path.join(outdir, 'julia-console.json')))
8+
fs.writeFileSync(path.join(outdir, 'julia-console.cson'), CSON.stringify(consoleGrammar, null, 2))
9+
610
let grammar = JSON.parse(fs.readFileSync(path.join(outdir, 'julia.template.json')))
711

812
const templateRules = {

0 commit comments

Comments
 (0)