Comments (9)
Hi @bardo84, can you please post an example?
from gravity.
Repro steps
Test.gravity
func main() {
System.print("Run Tests!")
error
}
Run
gravity Test.gravity
Expected
Error reported in file "Test.gravity" on line 3 character 2
Actual
SEMANTIC ERROR on 0 (5,2): Identifier error not found.
from gravity.
Should the '0' value be the file name?
from gravity.
FYI: Windows 11 running VS 2022 Version 17.4.3
from gravity.
Thanks @mwasplund, I see that you closed your pull request? That means that it was not ready to be applied?
from gravity.
Should the '0' value be the file name?
'0' is the fileID, the user is responsible to save the filename associated to each fileID.
See comment in
Line 64 in 971337c
from gravity.
Yes, it appears that in some cases when calling is_newline the current offset is pointing to the actual current token and in some cases it is already pointing to next. Still working out why this is the case.
from gravity.
I think that a good starting point to investigate is the is_newline
function in gravity_lexer.c
gravity/src/compiler/gravity_lexer.c
Line 76 in 971337c
from gravity.
That was were I was looking, I had updated the checks in that method to use PEEK_NEXT instead of PEEK_CURRENT. This resolved a lot of issues where the LF was getting missed and then double counted. However, it appears that in some cases the caller is "peeking" in which case the next char is actually current... I sent an update to pass in the exact next and next2 characters to the is_newline call. Not the prettiest, but it is working. Let me know if you see a cleaner way to achieve the difference in state between calls.
from gravity.
Related Issues (20)
- Make install doesn't install libraries nor headers
- Problems compiling without GRAVITY_COMPUTED_GOTO being set HOT 2
- Thinking about writing a book
- [Feature] #include guards HOT 1
- Runtime Error Should Report File and Line Number HOT 3
- lambda captured HOT 1
- Gravity documentation update to latest HOT 1
- C like conditional compilation and suggested features HOT 2
- Documentation section arrow eats into section name HOT 3
- 2023 roadmap?
- Please add syntax highlighting for Sublime Text
- Please implement REPL
- better cli-rework
- Makefile dependency errors
- Evaluate using Profile-Guided Optimization (PGO) and LLVM BOLT
- Automatic native function/class identifier registration on gravity parser HOT 1
- Gravity language windows install instructions HOT 1
- RUNTIME ERROR: Unknown LOADK index
- hello can we run gravity on microcontroller ? HOT 4
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 gravity.