mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-14 11:16:17 +01:00
added support for shebangs: if the file starts with "#!", the first line will be ignored.
This commit is contained in:
@@ -32,6 +32,11 @@ impl Display for FilePosition {
|
||||
|
||||
impl File {
|
||||
pub fn new(data: String, path: PathBuf) -> Self {
|
||||
let data = if data.starts_with("#!") {
|
||||
&data[data.lines().next().unwrap().len()..].trim_start()
|
||||
} else {
|
||||
data.trim_start()
|
||||
};
|
||||
let mut chs = data.chars();
|
||||
let mut data = String::with_capacity(data.len());
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user