Compare commits

..

2 Commits

Author SHA1 Message Date
d377c8448f nix: replace rust-overlay with fenix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-08-14 14:19:17 +05:30
af30410aab parser: fix newline checks after statements
since there is no EOL delimiter like ';', we have to check for newline to avoid something like `a = 4 + 4 b = a`
also added tests for expr parsing

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2023-08-14 00:57:17 +05:30
3 changed files with 9 additions and 7 deletions

View File

@@ -9,25 +9,28 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
rust-overlay = { fenix = {
url = github:oxalica/rust-overlay; url = github:nix-community/fenix;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = github:numtide/flake-utils; flake-utils.url = github:numtide/flake-utils;
}; };
outputs = inputs@{ self, nixpkgs, crane, rust-overlay, flake-utils }: outputs = inputs@{ self, nixpkgs, crane, fenix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ rust-overlay.overlays.default ]; overlays = [ fenix.overlays.default ];
}; };
inherit (pkgs) lib; inherit (pkgs) lib;
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; toolchain = pkgs.fenix.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-n8LtGbpj/yCUGo0NFJ7FNv9fSdT9oKEUl+EPLg06JdQ=";
};
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;
src = craneLib.cleanCargoSource (craneLib.path ./.); src = craneLib.cleanCargoSource (craneLib.path ./.);

View File

@@ -12,7 +12,7 @@ pub enum Entity {
Fn(Fn), Fn(Fn),
Class(Class), Class(Class),
Module(Module), Module(Module),
Static(Let) Static(Let),
} }
/// A module just provides an additional scope /// A module just provides an additional scope

View File

@@ -14,7 +14,6 @@ use crate::ast::{
use crate::lexer::{ use crate::lexer::{
Lexer, Lexer,
Token, Token,
TokenDelimiter,
TokenKeyword, TokenKeyword,
TokenKind, TokenKind,
TokenSymbol, TokenSymbol,