Git Product home page Git Product logo

Comments (7)

ironsheep avatar ironsheep commented on September 27, 2024

Hmm... seeing spin code in .spin2 files and spin2 in .spin files. They have a lot of red because of incorrect language in the given file, BUT I'm not seeing any lockups.

hexagon_sdda.spin2 (Spin V2 language) contains spin (v1) object constant uses: Ex:

line(61) erc:=\fat.FATEngineStart(plat#SD_DO,plat#SD_CLK,plat#SD_DI,plat#SD_SELECT,false)

hexagon.spin (Spin V1 language) contains spin2 method uses: Ex:

line(333):   wrpin(plat#CONTROLACC_BASEPIN+4+(3<<6),P_NORMAL|P_LOW_150K|P_HIGH_FLOAT)
line(334):  pinl(plat#CONTROLACC_BASEPIN+4+(3<<6))

platform.spin (Spin V1 language) contains non spin(or spin2) object declaration: Ex:

line(48): OBJ video = "p2videodrv.spin2"

This should be a colon vs. an "=" separator.

Wow, and the Syntax parser is not coloring the platform.spin file. This I'm looking into...
Um, NOPE, never mind. This appears to be due to the syntax parser being unable to handle the undeclared first section of CON. This is a known bug.

from p2-vscode-extensions.

ironsheep avatar ironsheep commented on September 27, 2024

I have no plans to support mixed p1 and p2 syntax in the same file. So I'm not sure I can do anything about these.

What do you think should be fixed if there's no lockup?

I am adding error reporting for object declarations that I can't parse!

from p2-vscode-extensions.

Wuerfel21 avatar Wuerfel21 commented on September 27, 2024

The = style object declaration is a flexspin feature. It means something special (reference class but don't instantiate an instance - you can use the subscript operator to then access an instance through a pointer - also good if you just need to reference constants)

from p2-vscode-extensions.

ironsheep avatar ironsheep commented on September 27, 2024

sdspi_with_audio.spin2 (Spin v2 language) missing org directives at start of DAT (required to enter pasm parser.) ex:

dat 'do_init     'RJA disabled smartpins
do_init

                getbyte pinDO,          arg1_in,    #0
                getbyte pinCLK,         arg1_in,    #1

The parser fails to handle this correctly as it is not data declarations so it flags lots of random bits.

Also found a missing comment "'" at:

con  smartpin_constants

so it flagged smartpin_constants as a constant expression missing the '=' assignment part.

from p2-vscode-extensions.

ironsheep avatar ironsheep commented on September 27, 2024

FOUND: VJET_p2beta_displaylist.spin2 (Spin V2 language) 1 line is causing the parser crash:

PUB line_polygon(polyptr,vcount,width,colors) | i,px,py

  px := long[polyptr][(vcount<<1)-2]
  py := long[polyptr][(vcount<<1)-1]
  repeat i from 0 to vcount-1
     line(px,py,px := long[polyptr][(i<<1)],py := long[polyptr][(i<<1)+1],width,colors)

The last line causes a crash. It shouldn't happen.

Hrmf... not a crash per see, my new parser was mis-tokenizing the statement then couldn't find the mashed parts. so generating errors with bad char offsets.

So, let me understand this code.

I think you are implying this:

PUB line_polygonSimple(polyptr,vcount,width,colors) | i, px, py, px2, py2

  px := long[polyptr][(vcount<<1)-2]
  py := long[polyptr][(vcount<<1)-1]
  repeat i from 0 to vcount-1
    px2 := long[polyptr][(i<<1)]
    py2 := long[polyptr][(i<<1)+1]
    line(px,py,px2,py2,width,colors) 

...with you intending to save from allocating two more variables but counting on the compiler's order of operations to keep the old and new px and py values correct.

Am I right?

from p2-vscode-extensions.

Wuerfel21 avatar Wuerfel21 commented on September 27, 2024

yes, that's roughly how that works. It wants to draw lines between points, so each point needs to be used twice. The previous point is stored in px/py, which is updated in the same statement where it just got used.

from p2-vscode-extensions.

Wuerfel21 avatar Wuerfel21 commented on September 27, 2024

Appears to be fixed in current version

from p2-vscode-extensions.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.