Skip to content

Commit

Permalink
Switch pragma behavior to be a bit closer to before previous fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alasdair committed Aug 2, 2023
1 parent 5365d21 commit fa0c077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion isla-lib/src/ir_lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ lexer! {
},

'#' $id_start $id_continue* $$whitespace (_ # '\n')* '\n' => |lexer| {
let pragma_line = lexer.match_();
let pragma_line = &lexer.match_()[1..];
let (pragma, args) = pragma_line.split_once(char::is_whitespace).unwrap();
lexer.return_(Tok::Pragma(pragma, args.trim()))
},
Expand Down
4 changes: 2 additions & 2 deletions isla-lib/src/ir_parser.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ pub Def: Def<Name, B> = {
<p:"pragma"> => {
let name = p.0;
let s = p.1;
if name == "#tuplestruct" {
if name == "tuplestruct" {
let mut iter = s.split_whitespace();
let id = iter.next().map(|tuple| symtab.intern(tuple)).expect("malformed #tuplestruct pragma in IR");
let mut fields = Vec::new();
for field in iter {
fields.push(symtab.intern(field))
}
symtab.tuple_structs.insert(id, fields);
} else if name == "#mangled" {
} else if name == "mangled" {
let (original, mangled) = s.split_once(' ').expect("malformed #mangled pragma in IR");
let mangled = symtab.intern(mangled);
symtab.mangled_names.insert(mangled, original);
Expand Down

0 comments on commit fa0c077

Please sign in to comment.