vjekob / al-pragma-explorer Goto Github PK
View Code? Open in Web Editor NEWLet's build a VS Code extension for AL Language!
License: MIT License
Let's build a VS Code extension for AL Language!
License: MIT License
Hey guys,
inspired by something that Vjeko mentioned during one of the pauses, I tried my hand at writing a state machine "lexer" to parse the files.
My results are mixed, to say the least ;-)
(I had no idea what I was doing here, this might be ridiculously wrong and if you laugh your head off, please let me parttake in your amusement :D)
My guess is that this code creates overhead which the JScript interpreter doesn't have to deal with in the current parsing code.
It actually works, but it seems to perform a bit worse than the original code in my tests.
Lexer Code:
src/parser/Lexer.ts
https://pastebin.com/vJnHqv8z
A simple way to implement it is to add this to src/parser/parse.ts :
const lexerParser = new LexerParser(uri); const results = lexerParser.readFile(); return results;
(Above the current parsing code, comment the rest out.)
Thanks for having a look, kind regards,
Wolfram
Here's some stopwatch code in case you want to measure results:
var startTime: Date, endTime: Date;
function start() {
startTime = new Date();
}
function end() {
endTime = new Date();
var timeDiff = endTime.getMilliseconds() - startTime.getMilliseconds(); //in ms
console.log(timeDiff + ' milliseconds');
}
Hi all,
I hope you are doing well. Currently, we have implemented to have the pragma in app.json only. According to the docs: (Compiler Directives), we can also have them using #DEFINE "MYPRAGMA".
The main differences are: These pragmas are file scoped.
Would love to try that
Hi Vjeko,
I really like your new extension, thx for supporting our community.
Sometimes I use if not pragma in my projects, at the moment these are presented twice in the pragma-explorer.
Maybe you can change this in one of the next releases.
Thanks, Martin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.