Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser error #3

Open
ToastyStoemp opened this issue Nov 28, 2022 · 2 comments
Open

Parser error #3

ToastyStoemp opened this issue Nov 28, 2022 · 2 comments

Comments

@ToastyStoemp
Copy link

ToastyStoemp commented Nov 28, 2022

Hey, running into this error:

Error
    throw peg$buildStructuredError(
    ^
peg$SyntaxError: Expected "at", "attr", "autoplace_cost180", "autoplace_cost90", "clearance", "descr", "fp_arc", "fp_circle", " "solder_mask_margin", "solder_paste_margin", "solder_paste_margin_ratio", "solder_paste_ratio", "tags", "tedit", "thermal_gap"
    at peg$buildStructuredError (G:\Other computers\Desktop\Keyboard\_Extra\KiCad\Kicad Parser\node_modules\kicad-to-json\src\m
    at Object.peg$parse [as parse] (G:\Other computers\Desktop\Keyboard\_Extra\KiCad\Kicad Parser\node_modules\kicad-to-json\sr
    at Object.parse (G:\Other computers\Desktop\Keyboard\_Extra\KiCad\Kicad Parser\node_modules\kicad-to-json\src\parse.js:11:3
    at Object.board (G:\Other computers\Desktop\Keyboard\_Extra\KiCad\Kicad Parser\node_modules\kicad-to-json\index.js:19:61)
    at Object.<anonymous> (G:\Other computers\Desktop\Keyboard\_Extra\KiCad\Kicad Parser\main.js:10:24)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
  expected: [
    { type: 'literal', text: 'version', ignoreCase: false },
    { type: 'literal', text: 'layer', ignoreCase: false },
    { type: 'literal', text: 'tedit', ignoreCase: false },
    { type: 'literal', text: 'tstamp', ignoreCase: false },
    { type: 'literal', text: 'at', ignoreCase: false },
    { type: 'literal', text: 'descr', ignoreCase: false },
    { type: 'literal', text: 'tags', ignoreCase: false },
    { type: 'literal', text: 'path', ignoreCase: false },
    {
      type: 'literal',
      text: 'solder_paste_margin_ratio',
      ignoreCase: false
    },
    { type: 'literal', text: 'solder_mask_margin', ignoreCase: false },
    { type: 'literal', text: 'solder_paste_margin', ignoreCase: false },
    { type: 'literal', text: 'solder_paste_ratio', ignoreCase: false },
    { type: 'literal', text: 'thermal_width', ignoreCase: false },
    { type: 'literal', text: 'clearance', ignoreCase: false },
    { type: 'literal', text: 'thermal_gap', ignoreCase: false },
    { type: 'literal', text: 'zone_connect', ignoreCase: false },
    { type: 'literal', text: 'autoplace_cost90', ignoreCase: false },
    { type: 'literal', text: 'autoplace_cost180', ignoreCase: false },
    { type: 'literal', text: 'attr', ignoreCase: false },
    { type: 'literal', text: 'fp_text', ignoreCase: false },
    { type: 'literal', text: 'fp_arc', ignoreCase: false },
    { type: 'literal', text: 'fp_circle', ignoreCase: false },
    { type: 'literal', text: 'fp_curve', ignoreCase: false },
    { type: 'literal', text: 'fp_line', ignoreCase: false },
    { type: 'literal', text: 'fp_rect', ignoreCase: false },
    { type: 'literal', text: 'fp_poly', ignoreCase: false },
    { type: 'literal', text: 'pad', ignoreCase: false },
    { type: 'literal', text: 'model', ignoreCase: false },
    { type: 'literal', text: 'zone', ignoreCase: false }
  ],
  found: 'p',
  location: {
    start: { offset: 6154, line: 227, column: 6 },
    end: { offset: 6155, line: 227, column: 7 }
  }
}

This is using KiCad 6

would appreciate some help

@jdthorpe
Copy link
Owner

Looks like Kicad 6 introduced some new syntax / options. Since Kicad uses a hand-written parser, it won't be obvious what changes they made that introduced the new schema -- so I would need an example file that raises this error. Would, you be able to share a the file or a link to a file that raises this error? (The smaller the better).

If you're not able to share the whole file, can you open the kicad file in a text editor and copy the relevent section? I can see from the error that the new / invalid syntax is on line 227 of your kicad file, so possibly just the first 227 lines would be sufficient...

@ToastyStoemp
Copy link
Author

Sure no problem, here is a sample project:
https://drive.google.com/file/d/194fkAp9rbQRIXtIBTpL2YjYbg2UKKU7W/view?usp=share_link

jdthorpe pushed a commit that referenced this issue Sep 16, 2024
Allow for wrapping layer in quotes
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

No branches or pull requests

2 participants