Skip to content

Commit

Permalink
Some very quick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidawave committed Nov 20, 2023
1 parent 0ece1ad commit c4548ea
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
run:
cargo check -p ezno-parser --no-default-features

- name: Check checker without default features
if: steps.changes.outputs.checker == 'true'
run:
cargo check -p ezno-checker --no-default-features

formating:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ package = "ezno-checker"

[dependencies.parser]
path = "./parser"
version = "0.1.0"
version = "0.1.1"
features = ["extras"]
package = "ezno-parser"

Expand Down
2 changes: 1 addition & 1 deletion checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ erased-serde = "0.3"
[dependencies.parser]
path = "../parser"
optional = true
version = "0.1.0"
version = "0.1.1"
features = ["extras"]
package = "ezno-parser"
7 changes: 6 additions & 1 deletion checker/src/behavior/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{
Context, ContextType,
},
events::Event,
synthesis::interfaces::GetterSetter,
types::{
classes::ClassValue,
functions::SynthesisedParameters,
Expand Down Expand Up @@ -48,6 +47,12 @@ impl ThisValue {
}
}

pub enum GetterSetter {
Getter,
Setter,
None,
}

pub fn register_arrow_function<T: crate::ReadFromFS, M: crate::ASTImplementation>(
expecting: TypeId,
is_async: bool,
Expand Down
1 change: 0 additions & 1 deletion checker/src/behavior/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use source_map::{Span, SpanWithSource};

use crate::{
diagnostics::TypeCheckError,
synthesis::EznoParser,
types::{
cast_as_number, cast_as_string, is_type_truthy_falsy, new_logical_or_type,
StructureGenerics, TypeStore,
Expand Down
7 changes: 2 additions & 5 deletions checker/src/synthesis/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use parser::{

use crate::{
behavior::functions::{
function_to_property, ClassPropertiesToRegister, FunctionRegisterBehavior,
function_to_property, ClassPropertiesToRegister, FunctionRegisterBehavior, GetterSetter,
},
context::{
environment,
Expand All @@ -28,10 +28,7 @@ use crate::{
ASTImplementation, CheckingData, PropertyValue, Scope, Type, TypeId,
};

use super::{
block::synthesise_block, expressions::synthesise_expression, interfaces::GetterSetter,
EznoParser,
};
use super::{block::synthesise_block, expressions::synthesise_expression, EznoParser};

/// Doesn't have any metadata yet
///
Expand Down
8 changes: 1 addition & 7 deletions checker/src/synthesis/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use parser::{
};

use crate::{
behavior::functions::{self, ThisValue},
behavior::functions::{self, GetterSetter, ThisValue},
context::{
facts::Publicity,
Environment, {Context, ContextType},
Expand Down Expand Up @@ -51,12 +51,6 @@ pub(crate) trait SynthesiseInterfaceBehavior {
fn interface_type(&self) -> Option<TypeId>;
}

pub enum GetterSetter {
Getter,
Setter,
None,
}

pub(crate) enum InterfaceValue {
Function(FunctionType, GetterSetter),
Value(TypeId),
Expand Down
7 changes: 4 additions & 3 deletions checker/src/types/classes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::{
behavior::functions::ClassPropertiesToRegister, context::facts::Publicity, events::Event,
synthesis::interfaces::GetterSetter, ASTImplementation, CheckingData, Environment,
PropertyValue, TypeId,
behavior::functions::{ClassPropertiesToRegister, GetterSetter},
context::facts::Publicity,
events::Event,
ASTImplementation, CheckingData, Environment, PropertyValue, TypeId,
};

use super::properties::PropertyKey;
Expand Down
2 changes: 1 addition & 1 deletion parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ezno-parser"
description = "Parser and AST definitions for Ezno"
authors = ["Ben <[email protected]>"]
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "MIT"
repository = "https://github.com/kaleidawave/ezno"
Expand Down
4 changes: 2 additions & 2 deletions parser/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ezno-ast-generator"
description = "Quasi-quoted constant compiled TS definitions for Ezno AST"
authors = ["Ben <[email protected]>"]
version = "0.0.8"
version = "0.0.9"
edition = "2021"
license = "MIT"
repository = "https://github.com/kaleidawave/ezno"
Expand All @@ -17,7 +17,7 @@ proc-macro = true
quote = "1.0"
proc-macro2 = "1.0"
self-rust-tokenize = "0.3.3"
ezno-parser = { path = "..", version = "0.1.0", features = [
ezno-parser = { path = "..", version = "0.1.1", features = [
"self-rust-tokenize",
] }

Expand Down
4 changes: 2 additions & 2 deletions src/js-based-plugin/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function emitDiagnostics(on, diagnostics, plugin) {
/** @param {import("./types").EznoUnpluginOptions} options */
function plugin(options = {}) {
let all_js_ts_files = options.all_js_ts_files ?? false;
const build = options.customBuild ?? ezno_build;

// TODO the other 50
const extensions = ["ts", "tsx", "js", "jsx"];

const build = options.customBuild ?? ezno_build;

const name = "ezno";
const esbuild = {
name,
Expand Down
2 changes: 1 addition & 1 deletion src/js-based-plugin/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type ReadFromFS = (path: string) => string | null;

export interface EznoUnpluginOptions {
/** Defaults to only running on .ezno.* files */
all_js_ts_files: bool,
all_js_ts_files?: bool,

customBuild?: (cb: ReadFromFS, entryPath: string, minify: bool) => any
}

0 comments on commit c4548ea

Please sign in to comment.