<bronaugh>
don't suppose you're good with ocamlyacc?
<bronaugh>
trying to figure out how to implement comments.
<lix-goo>
ocaml-style comments ?
<lix-goo>
that's tricky
<bronaugh>
Perl-style.
<bronaugh>
just line beginning with #
<bronaugh>
not middle-of-line or anything.
<lix-goo>
OK so just skip #.*\n in the lexer
<lix-goo>
rule token = parse
<lix-goo>
| '%' [^'\n'] * '\n' { token lexbuf }
<lix-goo>
| blank { token lexbuf }
<lix-goo>
| '\n' { token lexbuf }
<lix-goo>
| "." { DOT }
<lix-goo>
here's an example, just s/%/#/
<lix-goo>
it just tells the lexer to skip comments (and blanks, newlines) and lex again after
<bronaugh>
cool.
<bronaugh>
well, that works.
gim_ has joined #ocaml
mikeX has joined #ocaml
dozer has joined #ocaml
Skal has joined #ocaml
rossberg has quit ["Leaving"]
pango is now known as pangoafk
bohanlon has quit ["It is sleepy time for my computer."]
bohanlon has joined #ocaml
bluestorm has joined #ocaml
bohanlon has quit ["It is sleepy time for my computer."]
<dozer>
If I have a pair (a, b), is there a built-in that lets me extract a, or extract b?
<dylan>
yes, check Pervasives.
<dylan>
hint: fst and snd
* dozer
embarased
<dozer>
how many times have I scanned up and down this, and seen the List operations heading, but not Pair operations
<dylan>
Heh. :)
<dylan>
This is why it's good to ask people; people are better at certain types of information retrieval. :)
<dozer>
:-)
<dylan>
Like, for a while I thought I had to use the unix module, mtime, and a try ... with statement to test if a file existed...
<dylan>
until I stumbled upon Sys.file_exists
<mikeX>
ouch
Snark has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
glad to annonuce the bootstrapping ofthe ocaml 3.09.1 compiler on BeOS !! (i586-pc-beos architecture)
<bluestorm>
again ? :)
<zmdkrbou>
:D
<Anarchos>
bluestorm hmm yes :) cause nobody noticed it :(
* zmdkrbou
doesn't any body using beos ...
<bluestorm>
it seems you're looking for an ocaml developper or something like that
<bluestorm>
why don't you send them a mail ?
<Anarchos>
yes i will do that
<bluestorm>
but if you want some congratulations, i do congratulate. I personally have no idea of how difficult it is, but nevertheless i appreciate the performance :)
bohanlon has joined #ocaml
bohanlon has quit [Client Quit]
<Anarchos>
it is not difficult, just disabling some functions of the Unix library, some changes in the configure files, and adding some be-specific include files in the source
<Anarchos>
i also added some directives to be able to use the source of ocaml with a c++ compiler, avoiding the mangling of names
bohanlon has joined #ocaml
bohanlon has quit [Remote closed the connection]
ski has quit ["NMI"]
<dozer>
are there any situations where the content of a (* *) comment is parsed by ocamlc?
<zmdkrbou>
nope
<dozer>
then I am very confused
<dozer>
File "metaGrammar.ml", line 72, characters 27-28:
<dozer>
Syntax error
<dozer>
but line 72 is commented out
<dozer>
and if I insert a space in line 72 within the comment before char 27, the error changes to 28-29
<dozer>
(* output_string out "'"; *)
<zmdkrbou>
# (* output_string out "'"; *) 42 ;;
<zmdkrbou>
- : int = 42
<zmdkrbou>
i can't believe ocamlc reads into the comment
<dozer>
If I paste my offending code into a pastebin, would you mind running it through ocamlc?
<dozer>
just to see if you get the same strangeness