Skip to content

Commit dfa74bd

Browse files
committed
feat: code style, added eslint, improved language design a bit
1 parent 05e1e04 commit dfa74bd

79 files changed

Lines changed: 3534 additions & 2195 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ body {
9696
cols {
9797
col {
9898
include "includes/card" (
99-
$title "Card 1",
100-
$description "Description card 1",
101-
$url "https://www.elos-lang.com",
102-
$btnText "Nice!"
99+
title "Card 1",
100+
description "Description card 1",
101+
url "https://www.elos-lang.com",
102+
btnText "Nice!"
103103
)
104104
}
105105
col {
106106
include "includes/card" (
107-
$title "Card 2",
108-
$description "Description card 1",
109-
$url "https://www.elos-lang.com",
110-
$btnText "Read docs"
107+
title "Card 2",
108+
description "Description card 1",
109+
url "https://www.elos-lang.com",
110+
btnText "Read docs"
111111
)
112112
}
113113
}

bin/elos.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
import fs from 'fs';
4-
import path, {dirname} from 'path';
4+
import path, { dirname } from 'path';
55
import { Elos } from '../dist/index.js';
66

77
const args = process.argv.slice(2);
88
if (args.length < 1) {
9-
console.error('Usage: elos <input-file> [output-file]');
10-
process.exit(1);
9+
console.error('Usage: elos <input-file> [output-file]');
10+
process.exit(1);
1111
}
1212

1313
const inputFile = args[0];
@@ -16,16 +16,16 @@ const filename = path.resolve(inputFile);
1616
const filepath = dirname(filename);
1717

1818
if (!fs.existsSync(filename)) {
19-
console.error(`Error: File not found: ${inputFile}`);
20-
process.exit(1);
19+
console.error(`Error: File not found: ${inputFile}`);
20+
process.exit(1);
2121
}
2222

2323
const code = fs.readFileSync(filename, 'utf-8');
2424
const output = Elos.make(code, filepath);
2525

2626
if (outputFile) {
27-
fs.writeFileSync(outputFile, output, 'utf-8');
28-
console.log(`Output written to ${outputFile}`);
27+
fs.writeFileSync(outputFile, output, 'utf-8');
28+
console.log(`Output written to ${outputFile}`);
2929
} else {
30-
process.stdout.write(output);
30+
process.stdout.write(output);
3131
}

0 commit comments

Comments
 (0)