Skip to content

Commit

Permalink
Merge pull request #5 from wez/symbolorder-kicad5
Browse files Browse the repository at this point in the history
kicad5: allow ALIAS or $FPLIST to be in either order
  • Loading branch information
adamheinrich authored May 21, 2019
2 parents b44829e + 4f22808 commit b1b62bf
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/symbol_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,23 +684,29 @@ fn parse_symbol(p: &mut ParseState) -> Result<Symbol, KicadError> {
break;
}
}
if &p.here() == "$FPLIST" {
p.next();
// skip FPLIST for now
while !p.eof() {
if &p.here() == "$ENDFPLIST" {
p.next();
break;
}
p.next()
loop{
if &p.here() == "DRAW" {
break;
}
}
if p.here().starts_with("ALIAS") {
let v = parse_split_quote_aware(&p.here())?;
for alias in v.into_iter().skip(1) {
s.aliases.push(alias)
if &p.here() == "$FPLIST" {
p.next();
// skip FPLIST for now
while !p.eof() {
if &p.here() == "$ENDFPLIST" {
p.next();
break;
}
p.next()
}
} else if p.here().starts_with("ALIAS") {
let v = parse_split_quote_aware(&p.here())?;
for alias in v.into_iter().skip(1) {
s.aliases.push(alias)
}
p.next();
} else {
break;
}
p.next();
}
// TODO draw
assume_line!(p, "DRAW");
Expand Down

0 comments on commit b1b62bf

Please sign in to comment.