From: "dream.designer" <vadim.shender@gmail.com>
To: caml-list@inria.fr
Subject: CamlP4 lexer problem
Date: Mon, 30 Jun 2008 20:46:57 +0300 [thread overview]
Message-ID: <982cea130806301046p48b54dd5l23e81c703cb26b68@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]
Hello everyone.
I'm trying to write a syntax extension that introduces two new tokens "[%"
and "%]". But I'm getting a syntax error if token ")" follows token "%]".
Could anybody help me please?
Here's the minimal syntax extension code that reproduces the issue:
===================================================================
open Camlp4.PreCast
open Syntax
EXTEND Gram
expr:
[ [ "[%"; e = expr LEVEL "simple"; "%]" -> e ] ] ;
END ;;
===================================================================
Usage sample:
===================================================================
# [% 5 %] ;;
- : int = 5
# ([% 5 %]) ;;
Characters 6-9:
([% 5 %]);;
^^^
Parse error: [expr level simple] expected after "[%" (in [expr])
===================================================================
Thanks in advance.
--
vadim.shender@gmail.com
[-- Attachment #2: Type: text/html, Size: 2602 bytes --]
next reply other threads:[~2008-06-30 17:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 17:46 dream.designer [this message]
2008-06-30 19:18 ` [Caml-list] " Richard Jones
2008-06-30 19:24 ` Vadim Shender
2008-07-01 10:16 ` Nicolas Pouillard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=982cea130806301046p48b54dd5l23e81c703cb26b68@mail.gmail.com \
--to=vadim.shender@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).