-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
31 changed files
with
4,668 additions
and
171 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,6 +1,3 @@ | ||
* text eol=lf | ||
|
||
src/** linguist-generated | ||
bindings/** linguist-generated | ||
binding.gyp linguist-generated | ||
Cargo.toml linguist-generated |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('.').chatito; |
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 @@ | ||
module.exports = require('.').chatl; |
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,14 +1,23 @@ | ||
fn main() { | ||
let src_dir = std::path::Path::new("src"); | ||
let chatito_dir = std::path::Path::new("src"); | ||
let ext_dir = std::path::Path::new("extensions"); | ||
let chatl_dir = ext_dir.join("chatl").join("src"); | ||
// let chatette_dir = ext_dir.join("chatette").join("src"); | ||
|
||
let mut c_config = cc::Build::new(); | ||
c_config.include(src_dir); | ||
c_config | ||
let mut config = cc::Build::new(); | ||
config.include(chatito_dir); | ||
config | ||
.flag_if_supported("-Wno-unused-parameter") | ||
.flag_if_supported("-Wno-unused-but-set-variable"); | ||
let parser_path = src_dir.join("parser.c"); | ||
c_config.file(&parser_path); | ||
|
||
c_config.compile("parser"); | ||
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); | ||
for path in &[ | ||
chatito_dir.join("parser.c"), | ||
chatl_dir.join("parser.c"), | ||
// chatette_dir.join("parser.c") | ||
] { | ||
config.file(path); | ||
println!("cargo:rerun-if-changed={}", path.to_str().unwrap()); | ||
} | ||
|
||
config.compile("parser"); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// <reference types="node"/> | ||
|
||
const {execSync} = require('node:child_process'); | ||
const {join} = require('node:path'); | ||
|
||
console.log('building chatito...'); | ||
execSync('tree-sitter generate --no-bindings', {stdio: 'inherit'}); | ||
|
||
console.log('building chatl...'); | ||
process.chdir(join(__dirname, 'extensions', 'chatl')); | ||
execSync('tree-sitter generate --no-bindings', {stdio: 'inherit'}); | ||
|
||
// console.log('building chatette...'); | ||
// process.chdir(join(__dirname, 'extensions', 'chatette')); | ||
// execSync('tree-sitter generate --no-bindings', {stdio: 'inherit'}); |
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,34 @@ | ||
/** | ||
* @file Tree-sitter grammar definition | ||
* @author ObserverOfTime | ||
* @license MIT | ||
*/ | ||
|
||
/// <reference types="tree-sitter-cli/dsl"/> | ||
|
||
const CHATITO= require('../../grammar'); | ||
|
||
module.exports = grammar(CHATITO, { | ||
name: 'chatl', | ||
|
||
rules: { | ||
eq: _ => '=', | ||
|
||
string: $ => choice( | ||
field('content', repeat1(/\S/)), | ||
seq( | ||
field('quote', '`'), | ||
field( | ||
'content', | ||
repeat(choice( | ||
/[^`\\\r\n]/, | ||
$.escape | ||
)) | ||
), | ||
field('quote', '`') | ||
) | ||
), | ||
|
||
_indent: _ => /[ ]{2}|[ ]{4}|\t/, | ||
} | ||
}); |
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,3 @@ | ||
{ | ||
"main": "../../bindings/node/chatl" | ||
} |
Oops, something went wrong.