#FurryScript

1 messages ยท Page 2 of 1

harsh frost
#

i need to finish jang lexer

#

it doesnt support hex values

grave spire
#

Rate my amazing first lexer

#

From 1-67

harsh frost
grave spire
#

Give me critique

harsh frost
#

lemme go to my keyboard

#

one sec

#

how is the parser supposed to know the difference between " and '

#

if im not wrong both are string

#

but with different rules

grave spire
#

i will split this into two cases then

#

or

#

i could just ignore it

#

compeltely

harsh frost
#

i will use orbls hxmini instead if you do that

grave spire
#

does hxmini iven have interpolation checking

harsh frost
#

but it works perfectly for modifying data

grave spire
#

it doesnt

#

even check

#

the quotes

#

it just removes them

#

so whats the complaint

harsh frost
#

im checking the code

grave spire
#

ill do the same (:

harsh frost
#

you know what

#

both projects suck

#

i will use kriptel hxon

grave spire
#

bruh this is my first lexer

#

and im doing it the hard way

#

char by char

#

instead of line by line

#

im not making my own buffered reader

harsh frost
#

๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€

#

๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€

grave spire
#

char by char works just fine

harsh frost
#

yeah

#

never do line by line

#

tf are you saying

grave spire
#

orbls is line by line

#

it splits lines until its components

harsh frost
#

im killing yall

grave spire
#

your saying this like

#

theres a book

#

explaining

#

how to write

#

a fully functional lexer

#

in haxe

#

if there was

#

id read it

harsh frost
#

ive spent so much time studying programming languages, lexers, and parsers, and you guys come up with this crap

harsh frost
grave spire
#

im doing this based on intuition and shitty logic

harsh frost
#

nonono

#

you know how to code

grave spire
#

thats how programming works

#

ah yes

harsh frost
grave spire
#

idiot

#

absolute idiot

#

software development and programming are two different things

harsh frost
#

bruuh

#

bruuuuh

grave spire
#

i can write code based on concepts

#

but i cant design a whole system

#

from scratch

#

without reference

harsh frost
#

ive used a rust tutorial

harsh frost
#

and applied what the tutorial says

#

to haxe

grave spire
#

then find a lexer

#

tutorial

#

fully

#

functioning

#

with step by step guide

#

and example code

harsh frost
# grave spire then find a lexer

This is the first part in a multipart ongoing series for building a minimal programming language in JavaScript. Today's video cover lexing and how to produce tokens needed for the parser stage.

Source code: https://github.com/tlaceby/guide-to-interpreters-series

If you want to follow along then please have a modern version of Deno installed a...

โ–ถ Play video
#

thats what i always send

grave spire
#

this is just my logic

#

but inside of a if statement

harsh frost
#

๐Ÿ˜ญ

#

i give up

grave spire
#

im using lexer states

#

to determine which chars

#

to add to a string buffer

#

based on conditions

#

every line is a keystate

#

then when it finds a =

#

its a value state

#

if it finds a # its a comment state

#

a # cant be inside a keystate with a key

harsh frost
#

your system doenst allow complex things.

#

thats all what im saying

grave spire
#

complex things like what

#

i can always make a new state

#

that state handles complex thigns

#

inside of that state i can manually move the pos forward or backwards

#

dependent on logic

#

like []

#

i can make a section state

#

that appends all values inside of []

#

to a sectionBuffer

harsh frost
grave spire
#

inside of the value

harsh frost
#

how do you will know if its a basic number like 12312312 or a hex number like 0x333

#

both start with a number

grave spire
#

detect if its a hex inside of appendValue

#

if its start with 0x

#

its mostly likely

#

a hex

harsh frost
#

and if not

#

if a coding interviewer saw that, youd get fired, it doesnt matter if you understand complex concepts if you dont know the basics of coding

grave spire
#

WHAT BASICS OF CODING

#

there is no basics to a lexer

#

im reading chars and converting them to tokens

#
hxenv/Lexer.hx:144: 2
hxenv/Lexer.hx:144: 3
hxenv/Lexer.hx:144: 4
hxenv/Lexer.hx:144: 5
hxenv/Lexer.hx:276: Detected as hex:,819
hxenv/Lexer.hx:144: 6
hxenv/Lexer.hx:144: 7```
harsh frost
#

you know, its useless talking to someone who doesnt want to listen, even alex gave you a "dude" after seeing your code

grave spire
#

What do you want me to do

#

I HAVE NO REFERENCE

#

this is my only reference

#
hxenv/Lexer.hx:144: 2
hxenv/Lexer.hx:144: 3
hxenv/Lexer.hx:144: 4
hxenv/Lexer.hx:144: 5
hxenv/Lexer.hx:144: 6
hxenv/Lexer.hx:144: 7
Main.hx:12: [Key(KEY),Equals,Value(VALUE),Comma,Comment(multiline),Newline,Value(VALUE2),Comma,Newline,Value(VALUE3),Newline,Newline,Key(KEY4),Equals,Value(VALUE4),Comment(test),Newline,Key(KEY5),Equals,Value(VALUE5),Comment(TEST),Newline,Eof]```
#

it works.

#

it has error handling

#

its env file format

#

simple syntax

#
hxenv/Lexer.hx:144: 2
hxenv/Lexer.hx:93: characters 5-10 : Uncaught exception Cant have comment in multiline
hxenv/Lexer.hx:134: characters 6-22 : Called from here
hxenv/Lexer.hx:66: characters 3-13 : Called from here
Main.hx:12: characters 15-33 : Called from here```
grave spire
#

"you dont know the basics of coding", "your system doesnt allow complex things"

#

all vague

hoary thunder
#

breaking my heart cro

harsh frost
hoary thunder
harsh frost
#

do you forgive me? ๐Ÿฅน

hoary thunder
#

yeah ๐Ÿฅน๐Ÿฅน๐Ÿฅน๐Ÿฅน

grave spire
#

The lexer goes with the approach of delayed emission

#

meaning it gets the context of the line

#

and then builds the token based on flags

harsh frost
#

niceiguess

grave spire
#

for multiline support ill make it so it doesnt reset the value buffer until its no longer a multiline

harsh frost
#

๐Ÿ‘

#

ihatelexers

grave spire
harsh frost
#

wha

#

thats my lexer

#

damn how i had the energy to write thousands of lines of code

#

๐Ÿ˜ญ

#

this is my parser

grave spire
#

write thousands of lines of code isnt hard

harsh frost
#

i write a hundred lines a week

#

sometimes a month

#

that project was made in three days

#

and im very happy with it

grave spire
#

im so scared

#

the wikapedia page of ASTs sucks

harsh frost
#

yep it sucks

hoary thunder
#
GitHub

Env Parser. Contribute to MonekyTheShep/HxEnv development by creating an account on GitHub.

GitHub

Haxelib for parsing data in the (ini/toml/cfg) format. - hackx2/hxmini

harsh frost
#

dayum

hoary thunder
#

this shit ain't real

#

this guy loves to bitch abt me using underscores Infront of my variable names ๐Ÿ˜ญ

harsh frost
#

underscores are cool

hoary thunder
quiet marten
#

Smh smh moneky blocked me

harsh frost
#

wha