Enumération des types de token
Infos de base d'un token
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user