-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
266 changed files
with
11,831 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
name: the/parser | ||
version: 0.3.3 | ||
version: 0.4.1 | ||
description: The programming language parser | ||
license: MIT | ||
main: src/main | ||
|
||
packages: | ||
the/testing: 0.3.0 | ||
|
||
scripts: | ||
update-parser-tests: the run scripts/update-parser-tests | ||
update-tokenizer-tests: the run scripts/update-tokenizer-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*! | ||
* Copyright (c) 2018 Aaron Delasy | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import parse, textify from "../src/parser" | ||
import parseTestFile from "../test/utils" | ||
|
||
main { | ||
files := fs_scandirSync("./test/parser") | ||
filesLen := files.len | ||
|
||
loop i := 0; i < filesLen; i++ { | ||
file := files[i] | ||
if file.slice(-4) != ".txt" { continue } | ||
print(file as str) | ||
|
||
result := parseTestFile("./test/parser/" + file) | ||
mut f := parse(result.in) | ||
stdoutCode := textify(ref f) | ||
|
||
fileResult := (result.in.empty ? "" : result.in + os_EOL) + result.delimiter + stdoutCode | ||
fs_writeFileSync("./test/parser/" + file, fileResult.toBuffer()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! | ||
* Copyright (c) 2018 Aaron Delasy | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as Reader from "../src/reader" | ||
import * as Tokenizer from "../src/tokenizer" | ||
import parseTestFile from "../test/utils" | ||
|
||
main { | ||
files := fs_scandirSync("./test/tokenizer") | ||
filesLen := files.len | ||
|
||
loop i := 0; i < filesLen; i++ { | ||
file := files[i] | ||
if file.slice(-4) != ".txt" { continue } | ||
|
||
result := parseTestFile("./test/tokenizer/" + file) | ||
mut reader := Reader.init(result.in) | ||
mut tokenizer := Tokenizer.init(ref reader) | ||
stdoutCode := Tokenizer.stringify(ref tokenizer, allowComments: file.contains("comment")) | ||
|
||
fileResult := result.in + os_EOL + result.delimiter + stdoutCode | ||
fs_writeFileSync("./test/tokenizer/" + file, fileResult.toBuffer()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.