Skip to content

Commit 053fe4e

Browse files
author
Josh Goldberg
committed
Mostly adjusted for Budgie rename
1 parent 388d74a commit 053fe4e

11 files changed

Lines changed: 50 additions & 54 deletions

File tree

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 HighSchoolHacking
3+
Copyright (c) 2019 budgielang
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# NGLS - Natural General Language Syntax
1+
# NBudgie - Natural Budgie 🦜
22

3-
[![Greenkeeper badge](https://badges.greenkeeper.io/general-language-syntax/NGLS.svg)](https://greenkeeper.io/)
3+
[![Greenkeeper badge](https://badges.greenkeeper.io/budgielang/NBudgie.svg)](https://greenkeeper.io/)
4+
[![Build Status](https://travis-ci.org/budgielang/NBudgie.svg?)](https://travis-ci.org/budgielang/NBudgie)
5+
[![NPM version](https://badge.fury.io/js/nbudgie.svg)](http://badge.fury.io/js/nbudgie)
46

5-
[![Build Status](https://travis-ci.org/HighSchoolHacking/NGLS.svg?)](https://travis-ci.org/HighSchoolHacking/NGLS)
6-
[![NPM version](https://badge.fury.io/js/ngls.svg)](http://badge.fury.io/js/ngls)
7+
A natural language layer on top of Budgie.
78

8-
A natural language layer on top of GLS.
9-
10-
[General Language Syntax (GLS)](https://github.com/highschoolhacking/gls) is a unified syntax that compiles into a number of OOP languages.
11-
NGLS converts natural language to GLS syntax, which can then be converted into real code.
9+
[General Language Syntax (Budgie)](https://github.com/budgielang/budgie) is a unified syntax that compiles into a number of OOP languages.
10+
NBudgie converts natural language to Budgie syntax, which can then be converted into real code.
1211

1312
<table>
1413
<thead>
15-
<th>NGLS</th>
16-
<th>GLS</th>
14+
<th>NBudgie</th>
15+
<th>Budgie</th>
1716
</thead>
1817
<tbody>
1918
<tr>
@@ -45,12 +44,12 @@ class end</pre></code>
4544
## Usage
4645

4746
```javascript
48-
const ngls = require("ngls");
47+
const nbudgie = require("nbudgie");
4948

50-
const nglsParser = ngls.createParser();
49+
const nbudgieParser = nbudgie.createParser();
5150

5251
// "comment line : Hello!"
53-
nglsParser.parseLines([
52+
nbudgieParser.parseLines([
5453
`note: Hello!`
5554
]);
5655
```

docs/Commands.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Commands
22

3-
Each supported GLS command corresponds to a directory of that command's name under `src/commands` containing:
3+
Each supported Budgie command corresponds to a directory of that command's name under `src/commands` containing:
44
* `matchers.ts` exporting a `MatchersList`
55
* `command.ts` exporting a `Command`
66
* `index.ts` exporting a method that creates an object with the corresponding `command` and `matchersList`
@@ -14,15 +14,15 @@ Matchers are typically implemented with a `RegExpMatchTest`, which takes in a ma
1414

1515
## `Command`
1616

17-
A command takes in a settings object and converts it to lines of GLS and/or recursive NGLS command, as one `string[]` per line.
18-
Recursive NGLS commands must start with `"{ "` and end with `" }"`.
17+
A command takes in a settings object and converts it to lines of Budgie and/or recursive NBudgie command, as one `string[]` per line.
18+
Recursive NBudgie commands must start with `"{ "` and end with `" }"`.
1919

2020
## Conversions
2121

22-
A NGLS-to-GLS conversion is performed on a series of lines in order.
22+
A NBudgie-to-Budgie conversion is performed on a series of lines in order.
2323

24-
A "command context" stack is kept during each conversion as a record of which GLS commands the lines are in scope of.
25-
For example, if an NGLS command results in an `if start` command, `"if start"` is added to the context.
24+
A "command context" stack is kept during each conversion as a record of which Budgie commands the lines are in scope of.
25+
For example, if an NBudgie command results in an `if start` command, `"if start"` is added to the context.
2626
It will remain there until an `if end` command removes it from the stack.
2727

2828
The conversion stack is necessary for parsing commands that may only exist as children in specific scopes.

docs/Development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Development
22

3-
NGLS uses [Gulp](http://gulpjs.com/) to automate building, which requires [Node.js](http://node.js.org).
3+
NBudgie uses [Gulp](http://gulpjs.com/) to automate building, which requires [Node.js](http://node.js.org).
44

55
To build from scratch, install Node.js and run the following commands:
66

@@ -18,7 +18,7 @@ Alternately, use `tsc` to build source files under `/src` to `/lib`, and `tsc -w
1818

1919
## Technical Structure
2020

21-
Each line of NGLS should compile to a GLS command and arguments.
21+
Each line of NBudgie should compile to a Budgie command and arguments.
2222
Blank lines are preserved.
2323
Unknown lines are considered comments.
2424

docs/Tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Tests
22

3-
In additional to standard unit tests, each supported GLS command corresponds to a directory of that command's name under `test/integration` containing:
4-
* `source.ngls` containing NGLS syntax
5-
* `expected.gls` containing the expected compiled GLS equivalent
3+
In additional to standard unit tests, each supported Budgie command corresponds to a directory of that command's name under `test/integration` containing:
4+
* `source.nbg` containing NBudgie syntax
5+
* `expected.bg` containing the expected compiled Budgie equivalent
66

77
These are verifified during `gulp test:integration`.
88

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ gulp.task("dist:dev", function () {
3636
debug: true,
3737
entries: "./src/index.ts",
3838
packageCache: {},
39-
standalone: "general-language-syntax"
39+
standalone: "budgie"
4040
});
4141

4242
return browsering
4343
.plugin(tsify)
4444
.bundle()
45-
.pipe(source("Ngls.js"))
45+
.pipe(source("NBudgie.js"))
4646
.pipe(buffer())
4747
.pipe(gulp.dest("./dist"));
4848
});

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
{
2-
"name": "ngls",
2+
"name": "nbudgie",
33
"version": "0.1.0",
4-
"description": "Natural language layer on top of GLS.",
4+
"description": "Natural language layer on top of Budgie.",
55
"main": "lib/index.js",
66
"scripts": {
77
"test": "gulp test"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/highschoolhacking/NGLS.git"
11+
"url": "git+https://github.com/budgielang/NBudgie.git"
1212
},
1313
"keywords": [
14-
"gls",
15-
"general",
16-
"language",
17-
"syntax",
14+
"budgie",
1815
"oop",
1916
"metalanguage",
2017
"natural",
@@ -29,9 +26,9 @@
2926
"author": "Josh Goldberg <joshuakgoldberg@outlook.com>",
3027
"license": "MIT",
3128
"bugs": {
32-
"url": "https://github.com/highschoolhacking/NGLS/issues"
29+
"url": "https://github.com/budgielang/NBudgie/issues"
3330
},
34-
"homepage": "https://github.com/highschoolhacking/NGLS#readme",
31+
"homepage": "https://github.com/budgielang/NBudgie#readme",
3532
"dependencies": {
3633
"@types/chai": "^4.2.4",
3734
"@types/mocha": "^5.2.7",

src/command.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { IContextChange, IContextTracker } from "./contextTracker";
22

33
/**
4-
* Converts parsed argument commands into GLS.
4+
* Converts parsed argument commands into Budgie.
55
*
66
* @type TCommandArgs Args for the command to convert from.
77
*/
88
export interface ICommand<TCommandArgs extends {} = {}> {
99
/**
10-
* Renders command arguments into GLS.
10+
* Renders command arguments into Budgie.
1111
*
1212
* @param args Parsed argument commands.
1313
* @param context Tracks the command context stack.
14-
* @returns Lines of GLS or recursive commands.
14+
* @returns Lines of Budgie or recursive commands.
1515
*/
1616
render(args: TCommandArgs, context: IContextTracker): IRenderedCommand;
1717
}
@@ -26,7 +26,7 @@ export interface IRenderedCommand {
2626
contextChange?: IContextChange;
2727

2828
/**
29-
* Lines of GLS or recursive commands.
29+
* Lines of Budgie or recursive commands.
3030
*/
3131
lines: string[][];
3232
}

src/parser.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ContextTracker, IContextTracker } from "./contextTracker";
44
import { IMatcher } from "./matchers";
55

66
/**
7-
* Parses raw string lines into GLS.
7+
* Parses raw string lines into Budgie.
88
*/
99
export class Parser {
1010
/**
@@ -22,7 +22,7 @@ export class Parser {
2222
}
2323

2424
/**
25-
* Parses raw lines of text into GLS.
25+
* Parses raw lines of text into Budgie.
2626
*
2727
* @param lines Raw lines to convert.
2828
* @returns A Promise for converting the lines.
@@ -50,12 +50,12 @@ export class Parser {
5050
}
5151

5252
/**
53-
* Parses a raw string line into GLS.
53+
* Parses a raw string line into Budgie.
5454
*
5555
* @param line A raw string line to convert.
5656
* @param contextTracker Tracks the command context stack.
5757
* @param deep Whether this is within a recursive command.
58-
* @returns The equivalent GLS, if possible.
58+
* @returns The equivalent Budgie, if possible.
5959
*/
6060
private parseLine(line: string, contextTracker: IContextTracker, deep?: true): string[] | undefined {
6161
for (const commandName of Object.keys(this.commandsAndMatchers)) {
@@ -88,9 +88,9 @@ export class Parser {
8888
/**
8989
* Recursively renders a command.
9090
*
91-
* @param shallowRenderedLines Lines of GLS or recursive commands.
91+
* @param shallowRenderedLines Lines of Budgie or recursive commands.
9292
* @param contextTracker Tracks the command context stack.
93-
* @returns Lines of GLS.
93+
* @returns Lines of Budgie.
9494
*/
9595
private recurseIntoCommand(shallowRenderedLines: string[][], contextTracker: IContextTracker): string[] {
9696
const realRenderedLines: string[] = [];

0 commit comments

Comments
 (0)