This repository was archived by the owner on Oct 12, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,5 +49,4 @@ lbd [options]
4949
5050## TODO
5151
52- - TODO: Add build instructions for Windows (MSVC toolchain).
5352- TODO: Provide better examples (e.g., Advent of Code snippets).
Original file line number Diff line number Diff line change @@ -6,14 +6,26 @@ false: Bool = \x: Any. \y: Any. y
66
77if_then: Any = \condition: Any.
88 \then_clause: Any. \else_clause: Any.
9- (condition then_clause else_clause)
9+ (condition then_clause else_clause)
1010
1111-- pairs
1212pair: Any = \x: Any. \y: Any. \fn: Any. (fn x y)
1313
1414first: Any = \x: Any. \y: Any. x
1515second: Any = \x: Any. \y: Any. y
1616
17- -- misc
18- float_eq: Float -> Float -> Bool = \x: Float. \y: Float.
19- (if_zero (cmp x y) true false)
17+ -- Relational Operators
18+ eq: Float -> Float -> Bool = \x: Float. \y: Float.
19+ (if_zero (cmp x y) true false)
20+
21+ lt: Float -> Float -> Bool = \x: Float. \y: Float.
22+ (if_zero (cmp (cmp x y) -1) true false)
23+
24+ gt: Float -> Float -> Bool = \x: Float. \y: Float.
25+ (if_zero (cmp (cmp x y) 1) true false)
26+
27+ lte: Float -> Float -> Bool = \x: Float. \y: Float.
28+ (if_zero (cmp x y) true (if_zero (cmp (cmp x y) -1) true false))
29+
30+ gte: Float -> Float -> Bool = \x: Float. \y: Float.
31+ (if_zero (cmp x y) true (if_zero (cmp (cmp x y) 1) true false))
Original file line number Diff line number Diff line change 2323 with open (GITIGNORE_PATH , "r" , encoding = "utf-8" ) as f :
2424 spec = pathspec .PathSpec .from_lines ("gitwildmatch" , f )
2525
26+ root : str
2627for root , _ , files in os .walk (BASE_DIR ):
28+ filename : str
2729 for filename in files :
2830 filepath : str = os .path .join (root , filename )
2931 rel_path : str = os .path .relpath (filepath , BASE_DIR )
Original file line number Diff line number Diff line change @@ -66,9 +66,7 @@ namespace fe::lexer {
6666 const std::string value = source.substr (start, pos - start);
6767 return {token::Iden{value}, cur_loc};
6868 }
69- // Float
70- // TODO: Negative numbers
71- if (std::isdigit (c)) {
69+ auto lex_float = [this , &c]() -> double {
7270 const size_t start = pos;
7371 while (std::isdigit (c)) {
7472 get ();
@@ -83,7 +81,11 @@ namespace fe::lexer {
8381 }
8482 }
8583 const double value = std::stod (source.substr (start, pos - start));
86- return {token::Float{value}, cur_loc};
84+ return value;
85+ };
86+ // Positive Float
87+ if (std::isdigit (c)) {
88+ return {token::Float (lex_float ()), cur_loc};
8789 }
8890 // String Literal: " ... "
8991 if (c == ' "' ) {
@@ -138,6 +140,10 @@ namespace fe::lexer {
138140 // After skipping comment, return the next token
139141 return next_token ();
140142 }
143+ // Negative Float
144+ if (std::isdigit (c)) {
145+ return {token::Float (-lex_float ()), cur_loc};
146+ }
141147 break ;
142148 default :
143149 break ;
Original file line number Diff line number Diff line change 55#include " lbd/fe/parser.h"
66#include " lbd/intp/interpreter.h"
77
8+ // TODO: Implement loading a file to repl
9+ // syntax: :load <filepath> or :l <filepath>
10+
811namespace repl {
912 static bool force_on_env_dump = false ;
1013 static bool debug_enabled = false ;
You can’t perform that action at this time.
0 commit comments