parsing shit right now... i'm sure i can simplify this
i am checking for combination types
>>61539179
This is disgusting
>>61539179
Looks like java, just use javacc if you want a parser.
What exactly is this being used for?
>>61539238
It's not java you stupid pajeet. It's javascript and that guy is dumb.
>>>/dpt/
>>61539269
Oh wait I forgot we can do this.
>>>/g/dpt
>>61539238
Just noticed the var, search for a javascript parser compiler if you care to make it clean.
Or just look up how to make parsers directly, not that you should.
>>61539287
You're doing it wrong
>>>/g/wdg
>>61539302
zuz
>>61539179
It's quite easy to generate a parser using Coco/R. It supports Java, so it might be something you'd want to look at.
>>61539179
regex
>>61539179
use comments motherfucker
>>61539395
I'm literally almost done.
after this step i'm doing all I have to do is work on the transpiler.
I think i can simplify that switch case structure by passing a particular object structure into a function.
I just created pic related.I should be able to use that.
_ is the type
__ is what can follow
$ is the function it will use to handle of the type-combo stops there....
"stops there" so that means we gotta check all the possible things that can come after and see if they're available. so this all takes place inside of an <element>
I can keep going and actually get to some code
var hit = false;
__.forEach(function(potential){
if( theNextElementsType == potential._ ){
hit = true;
}
});
>>61540554
Go back to India, Rajesh.
>>61540596
why? because I actually code?
>>61539179
you could put everything for r[i+1] and everything for r[i+2] in separate functions. That would make it more readable probably
Install Common Lisp
>>61540605
Jesus Christ dude, your """code""" is shit. The syntax is vomit inducing.
You have the dpt to show of your *code*
>>61541447
>someone shows their work
>call them a non-white slur.
>profit
seriously. go kill yourself.
>>61541476
>calling someone by a common name and pointing out their suspected region of origin is a slur
wat
does everything have to be race and offensive to you people?
OP, most of /g/ doesn't know how to code, and those who do aren't nearly as good as they think they are. they like to pretend like they "know better" but when it comes to actually showing their knowledge, they are silent. why? because they can't do any better. they just like to shit on you and call you "rajeesh" or "poojeet" because they lost their job to an indian coder, and they can't deal with the fact that a non-white is better than them at something.
your code is fine. and even if it's not optimal, maintainability and readability is 100x more important than performance in 99% of cases. and that last 1% is problems that are worked on by people way smarter than sperging autists here, jerking off over their unreadable codegolf-tier c++ solutions on a laotian hedge-trimming image board
>>61539179
Y A C C
A
C
C
L E X
E
X
>>61541729
This is definitely optimized more toward performance than maintainability and readability.
>>61541628
BTW I'm black.
I'm not gonna discuss this any more. Sam Harris openly said Africa needs more colonialism. Seriously not fucking around with that type of shit.
Create a BNF-type grammar and just use Jison
>>61542764
He is right nigger
>triple-nested switch/case
what the fuck are you trying to do
>>61541729
>maintainability and readability is 100x more important
Yes, which is why he should consider rewriting this.
>>61542764
>BTW I'm black.
Does everything have to be race with you people?
>>61541731
this tbqh familia