Skip to content

Problem with NUL character. #24

Open
jdgallag84 opened this Issue Mar 30, 2013 · 2 comments

2 participants

@jdgallag84

I cannot seem to lex the Null character in a string. I would like to have a lexer that can read the string
"ab\NULcd"
However, no matter what I tried, when running the lexer I get Lexical error.

Here is my definition

$escchars = [abfnrtv\\"\'&]
@escape = \ ($escchars | \NUL)
@gap = \ $white+ \
@string = $printable # [\"\] | " " | @escape | @gap

I would like to do

\" string* \" {\s -> String (strip s)}

(where strip removes the beginning and trailing ")

I have tried all kind of things for doing the null character from just NUL to \0 to 0, ... to copying Marlow's example definition of the ASCII characters, and nothing works. I always get a lexical error when trying to lex a file with a string with the NUL character in it.

Please help. Thank you!!

@simonmar
Owner

I believe this is fixed, but I can't construct an example that fails with alex-3.1.0. Can you provide a repro case please?

@mamash mamash pushed a commit to joyent/pkgsrc-wip that referenced this issue Nov 12, 2013
szptvlfn Update to 3.1.2
Changes in 3.1.2:
    Add missing file to extra-source-files
Changes in 3.1.1:
	Bug fixes (#24, #30, #31, #32)

( #32 => simonmar/alex#32 )
( #31 => simonmar/alex#31 )
( #30 => simonmar/alex#30 )
( #24 => simonmar/alex#24 )
757deed
@jdgallag84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.