Git Product home page Git Product logo

al-pragma-explorer's People

Contributors

alexceg avatar bjarkihall avatar dynaway-kmi avatar hr-valeri avatar kb-7 avatar kmi84 avatar olewunschmann avatar vjekob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

al-pragma-explorer's Issues

Parsing Speed: An attempt at a state machine

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.

  • I wonder if not instantiating an object of the LexerParser class and getting rid of a few if-statements could help
  • The step() code seems dirty compared to what I've seen, if it's correct this way at all
  • There's some unecessary variables and assignments in there

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');
}

[Enhancement] #define

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

#if not pragma ...

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.

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.