Enumération des types de token

Infos de base d'un token
This commit is contained in:
2024-03-29 08:40:02 +01:00
parent 0fcd4d09f1
commit 648a76e2e9
4 changed files with 132 additions and 6 deletions

View File

@@ -2,10 +2,10 @@ use std::env;
use std::fs;
use std::io;
use std::io::Write;
use crate::rlox::RLox;
use std::process;
pub mod rlox;
mod rlox;
use crate::rlox::RLox;
// Exit codes from #include <sysexits.h>
const EX_OK: i32 = 0;
@@ -54,10 +54,15 @@ fn run_prompt() -> i32 {
exit_code
}
fn run( script: String ) -> i32 {
fn run( _script: String ) -> i32 {
let rlox_interpreter = RLox { had_error: false };
if rlox_interpreter.had_error { EX_DATAERR } else { EX_OK }
}
// Implémentations de référence :
// https://github.com/munificent/craftinginterpreters/wiki/Lox-implementations#rust
// Pause :
// http://www.craftinginterpreters.com/scanning.html#regular-languages-and-expressions