<dh`>
so it's reasonable to suspect that it doesn't like the expression
<dh`>
(printing the column can make this sort of thing clearer)
<Anarchos>
64 is near the := and the 8
<dh`>
my first guess would be that the precedence declarations have altered the meaning of the grammar in an unexpected way
<dh`>
well, hold on, it said on line 8
<dh`>
line 1 is a comment
<Anarchos>
not hte line 8, but the '8' character
<dh`>
oh, that's the text. oops
* dh`
kan reed
<dh`>
first obvious thing is to fix the lexer so you get the right line number out :-)
<dh`>
my guess would be you aren't incrementing the line number on newline
germ- has joined #ocaml
germ has quit [Read error: Connection reset by peer]
<dh`>
so the first thing I see is that you have a COLON_EQ token but the rules for vardec use COLON EQ
<Anarchos>
the 1 is not the line, it is the first character position
<dh`>
with reasonable assumptions about the lexer, that will prevent := from matching COLON EQ because it'll come through as COLON_EQ
<Anarchos>
that is the problem ! I didn't see it thanks
<dh`>
re lines, the default expectation for positions is "file:line:column: message"
<Anarchos>
i never know if the smartest tokens are COLON_EQ for ':=' or COLON EQ
<dh`>
if you make them separate tokens, it'll accept "var x : = 3" and you probably don't want that
<dh`>
at least given normal treatment of whitespace in the lexer
<dh`>
so the basic principle is anything you want to be a lexical unit where whitespace/comments/whatnot can't appear in the middle should be its own token
<dh`>
so in a C grammar you have PLUS, PLUSEQ, PLUSPLUS, MINUS, MINUSEQ, MINUSMINUS, etc.
<dh`>
also my recommendation is: use names of glyphs for tokens and names of semantic operations in the downstream parse tree/ast
<dh`>
so STAR for *, MUL or MULT downstream
gareppa has quit [Quit: WeeChat 4.1.1]
<dh`>
also, split up that 200-character %token line :-)
<dh`>
(my suggestion would be: one %token line or group of lines for punctuation, separate one for reserved words; sometimes also makes sense to split the grouping punctuation out)
<dh`>
also I continue to recommend writing out the expression grammar and not using associativity declarations, but that's up to you
<dh`>
and, it looks like the parser won't accept this: for i := 0 to N do x[i] := i
<dh`>
and if you fix that, make sure that this: for i := 0 to N do x[i] := i + 1
<dh`>
groups the + correctly
<Anarchos>
dh` i have 52 test cases . I will do my best
<dh`>
also, do you mean to have both expseq and exp_seq?
<dh`>
and it looks like the distinction between the parens and sequencing rules is unnecessary
<dh`>
er, parentheses
<dh`>
that is: "parentheses" and "sequencing" are allowed in the exact same places. The first is a single expression in parens; the second is at least two separated by a semicolon
<dh`>
this can be replaced with a single version that accepts one or more
<dh`>
which then eliminates most of the distinction between expseq and exp_seq
<Anarchos>
dh` ok
mbuf has quit [Quit: Leaving]
germ- has quit [Ping timeout: 260 seconds]
germ has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Inline has quit [Ping timeout: 244 seconds]
Inline has joined #ocaml
Serpent7776 has quit [Ping timeout: 255 seconds]
Inline has quit [Ping timeout: 272 seconds]
noddy has quit [Quit: WeeChat 4.3.3]
noddy has joined #ocaml
bartholin has quit [Quit: Leaving]
chrisz has quit [Ping timeout: 244 seconds]
chrisz has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]