aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-10 18:15:27 +0100
committerGitHub <noreply@github.com>2021-03-10 18:15:27 +0100
commit21b76633d149f62dbfdf55702dbdf8c84bf14105 (patch)
tree4de4557fff6785e4527e9df206f909d96a930028 /src/compiler.rs
parente930f7b71ba526f40210f3e89afc79b2288e2e91 (diff)
parent035ac6f1a0fde887ccbdfb9358adddcb89a5bae3 (diff)
downloadsylt-21b76633d149f62dbfdf55702dbdf8c84bf14105.tar.gz
Merge pull request #109 from FredTheDino/minor
Diffstat (limited to 'src/compiler.rs')
-rw-r--r--src/compiler.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler.rs b/src/compiler.rs
index 9ab868f..0754a1e 100644
--- a/src/compiler.rs
+++ b/src/compiler.rs
@@ -596,8 +596,7 @@ impl Compiler {
/// The line of the current token.
fn line(&self) -> usize {
if self.section().tokens.len() == 0 {
- // unreachable!("An error occured without a section.");
- 666666
+ 0
} else {
self.section().tokens[std::cmp::min(self.current_token, self.section().tokens.len() - 1)].1
}
@@ -1782,7 +1781,7 @@ impl Compiler {
}
pub(crate) fn compile(&mut self, name: &str, file: &Path, functions: &[(String, RustFunction)]) -> Result<Prog, Vec<Error>> {
- let main = Variable::new("/main/", false, Type::Void);
+ let main = Variable::new("/preamble", false, Type::Void);
let slot = self.define(main).unwrap();
self.frame_mut().stack[slot].read = true;