Comments (7)
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.
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.
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.
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.
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.
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.
Appears to be fixed in current version
from p2-vscode-extensions.
Related Issues (17)
- Coloring Numbers in Symbols??? HOT 2
- Global labels in outline should be sub-items of the DAT block they are in HOT 2
- "long(..." incorrectly detected as label HOT 2
- OBJ include without space after colon highlights incorrectly HOT 3
- bad case statement highlight HOT 1
- highlight issues "else if" should NOT be legal for spin2 HOT 1
- Correctly highlight object constant overrides
- Publish to OpenVSX
- Overtype/Align toggle by default only active in Spin files HOT 1
- Flexspin conditional assembly not recognized and ends up polluting outline HOT 2
- Holding down F11 spawns multiple downloads HOT 3
- Show opening comment for DAT/CON sections HOT 5
- Single-line comment parsing issue HOT 5
- Missing X_4P_4DAC1_WFBYTE symbol HOT 5
- Caret/xor operator is treated as part of identifier HOT 2
- enumeration coloring HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p2-vscode-extensions.