Skip to content

Stim compiler#3305

Draft
joao-boechat wants to merge 16 commits into
mainfrom
joaoboechat/stim-compiler
Draft

Stim compiler#3305
joao-boechat wants to merge 16 commits into
mainfrom
joaoboechat/stim-compiler

Conversation

@joao-boechat

Copy link
Copy Markdown
Contributor

No description provided.

.chars
.peek()
.map_or(self.input_len as usize, |(i, _)| *i);
// TODO: What if some identifier starts with "rec" but is not a rec token?
}
}

//TODO: Deal with escaping
}

fn parse_item(&mut self) -> Option<Item> {
// TODO WHAT IF IT STARTS WITH A NEWLINE?
}
return Some(Item::Line(self.parse_line(instruction)));
} else {
// TODO error! The start of every item should be an instruction;
lo: span.lo + 5,
hi: span.hi - 1,
}),
), // Strips 'rec[-' prefix and trailing ']' TODO validate it
hi: span.hi - 1,
}),
),
}, // Strips 'sweep[' prefix and trailing ']' TODO validate it

fn main() {
let stim_code =
fs::read_to_string("examples/example.stim").expect("Failed to read examples/example.stim");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this file anywhere in the PR. Also, most of our tests use inline string of input/output to verify, rather than external files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for my manual testing, just so I can parse whole files at a time without having to edit the code every time. I will make sure to remove it before the official PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants