Giter VIP home page Giter VIP logo

ragel's People

Contributors

adrian-thurston avatar antage avatar bicycle1885 avatar collosi avatar computerquip avatar flameeyes avatar halcanary avatar hengestone avatar jengelh avatar jungshik avatar junhe77 avatar kbrow1i avatar kramelec avatar mingodad avatar oodler577 avatar phorward avatar podsvirov avatar rreverser avatar salzmdan avatar srl295 avatar vaporoid avatar verpeteren avatar ygrek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ragel's Issues

[ragel] can we sequence actions and conditions in arbitrary ways?

Right now the only way to get an action to execute before a condition is to use from-state actions. Would be better if we can sequence these using ordering in the ragel source code. This comes up when we want to initialize a variable referenced by a condition. For example, when counting things we need to use from-state actions to get the variable referenced by the condition initialized. Would be better if we could:

  1. Select the char
  2. Run the init action
  3. Test the condition
  4. Select the next level transition
  5. Maybe run more actions.

Currently a transition list is just two levels, with actions embedable only at the second level (after condition tested and transition selected). Maybe this implies an arbitrary number of levels. Or maybe we just want a syntax for putting actions in the top level, keeping the same structure. If we go that route then we can have just one kind of action list:

'foo' >action >cond >action

Anything before the cond goes into the top leve, anything after goes into the second level.

Need to work something out here, otherwise we are stuck with using leaving actions (something of a hack).

Is the exit transition being dropped correctly?

I am trying to resolve a simple non-determinism.

%%{
  machine query;

  # An application/x-www-form-urlencoded parser based on the
definition by WhatWG.
  # Based on https://url.spec.whatwg.org/#application/x-www-form-urlencoded
  pchar = any - [&=\[\]];

  # All transitions default to priority 0. We set the integer exit
priority to 1, which ensures a transition to the next state will only
invoke %integer_end (the lower priority %string_end transition is
discarded).
  integer = ([0-9]+) %(index, 1) >integer_begin %integer_end;
  string = (pchar+) $(index, 0) >string_begin %string_end;

  value = (pchar*) >value_begin %value_end;

  index = string (
    '[' (integer | string) ']'
  )* ('[]' %append)?;

  pair = (
    index ('=' value)?
  ) %pair;

  main := ((pair '&')* pair)?;
}%%

When parsing the following input: q[0]=0

I see that on the transition for ] it will invoke both %integer_end as well as %string_end. But I was under the impression the lower priority transition would be dropped.

Thanks for any advice you can give me.

[ragel] Support zig

Zig is currently lacking a composable parsing system.

I'm not sure if ragel is the right answer, compared to e.g. a PEG system in the standard library.

[ragel] no passthrough of UTF-8 magic

I found some problem with generated files on Windows platform.
if *.rl file is utf-8 file with signature (first 2 bytes EF BB).

Example:

input file lexer.rl
----- START ---------------
//=== this is first line (comment)
... // other lines
----- END ---------------

output file lexer.cs
----- START ---------------
/* #line 1 "lexer.rl" */
?//=== this is first line (comment)
... // other lines
----- END ---------------

ragel puts /* #line 1 "lexer.rl" */ comment before utf-8 signature at
the begining of file and this is wrong utf-8 file.

And second - if we disable #line generation with option -L, you remove
generation /* #line */ - not just comment this lines.

Best regards,
Denis Naumov.

[ragel] Index out of range

I've hit what appears to be a bug in ragel. As part of a larger machine, I've built a string parser that interprets "bare" strings (i.e. not enclosed within quotes).

The two-character start sequence check exists because there are valid sequences that begin with a character, followed by a symbol (such as u"). The rest of the machine is omitted from this test code for brevity.

The problem is that the generated code causes an index-out-of-bounds error. I've distilled the issue down to this test code:

decoder.rl

package ragelbug

import (
    "fmt"
)

%%{
    machine ragelbug;

    ws = [\r\n\t ];

    unquoted_first_char = [A-Za-z_];

    unquoted_second_char = unquoted_first_char | [0-9];

    unquoted_remaining_char = [0-9A-Za-z_];

    unquoted_string = unquoted_first_char unquoted_second_char @{
        fcall unquoted_string_iterate;
    };

    unquoted_string_iterate := unquoted_remaining_char* %{
        if err = callbacks.OnArrayData(data[arrayStart:fpc]); err != nil {
            fbreak;
        }
        if err = callbacks.OnArrayEnd(); err != nil {
            fbreak;
        }
        firstTwoCharacters = firstTwoCharacters[:0]
        fret;
    };

    main := unquoted_string ws* @/{
        err = fmt.Errorf("Incomplete document")
    };
}%%


%% write data;

type ArrayType int
const (
    ArrayTypeBinary = ArrayType(iota)
    ArrayTypeString
)

type DecoderCallbacks interface {
    OnArrayBegin(arrayType ArrayType) error
    OnArrayData(bytes []byte) error
    OnArrayEnd() error
}

func Parse(data []byte, callbacks DecoderCallbacks) (err error) {
    cs := 0
    p := 0
    pe := len(data)
    eof := pe
    top := 0
    stack := make([]int, 100)
    firstTwoCharacters := make([]byte, 0, 8)
    arrayStart := 0
    _ = eof
    
    %%{
        write init;
        write exec;
    }%%

    if cs == ragelbug_error {
        err = fmt.Errorf("Parse error at %v", p)
    }

    return
}

decoder.go (generated)

//line decoder.rl:1
package ragelbug

import (
    "fmt"
)


//line decoder.rl:36




//line decoder.go:16
var _ragelbug_actions []byte = []byte{
	0, 1, 0, 1, 1, 
}

var _ragelbug_key_offsets []byte = []byte{
	0, 0, 5, 12, 16, 
}

var _ragelbug_trans_keys []byte = []byte{
	95, 65, 90, 97, 122, 95, 48, 57, 
	65, 90, 97, 122, 13, 32, 9, 10, 
	95, 48, 57, 65, 90, 97, 122, 
}

var _ragelbug_single_lengths []byte = []byte{
	0, 1, 1, 2, 1, 
}

var _ragelbug_range_lengths []byte = []byte{
	0, 2, 3, 1, 3, 
}

var _ragelbug_index_offsets []byte = []byte{
	0, 0, 4, 9, 13, 
}

var _ragelbug_indicies []byte = []byte{
	0, 0, 0, 1, 2, 2, 2, 2, 
	1, 3, 3, 3, 1, 4, 4, 4, 
	4, 1, 
}

var _ragelbug_trans_targs []byte = []byte{
	2, 0, 3, 3, 4, 
}

var _ragelbug_trans_actions []byte = []byte{
	0, 0, 1, 0, 0, 
}

var _ragelbug_eof_actions []byte = []byte{
	0, 0, 0, 0, 3, 
}

const ragelbug_start int = 1
const ragelbug_first_final int = 3
const ragelbug_error int = 0

const ragelbug_en_unquoted_string_iterate int = 4
const ragelbug_en_main int = 1


//line decoder.rl:40

type ArrayType int
const (
    ArrayTypeBinary = ArrayType(iota)
    ArrayTypeString
)

type DecoderCallbacks interface {
    OnArrayBegin(arrayType ArrayType) error
    OnArrayData(bytes []byte) error
    OnArrayEnd() error
}

func Parse(data []byte, callbacks DecoderCallbacks) (err error) {
    cs := 0
    p := 0
    pe := len(data)
    eof := pe
    top := 0
    stack := make([]int, 100)
    firstTwoCharacters := make([]byte, 0, 8)
    arrayStart := 0
    _ = eof
    
    
//line decoder.go:95
	{
	cs = ragelbug_start
	top = 0
	}

//line decoder.go:101
	{
	var _klen int
	var _trans int
	var _acts int
	var _nacts uint
	var _keys int
	if p == pe {
		goto _test_eof
	}
	if cs == 0 {
		goto _out
	}
_resume:
	_keys = int(_ragelbug_key_offsets[cs])
	_trans = int(_ragelbug_index_offsets[cs])

	_klen = int(_ragelbug_single_lengths[cs])
	if _klen > 0 {
		_lower := int(_keys)
		var _mid int
		_upper := int(_keys + _klen - 1)
		for {
			if _upper < _lower {
				break
			}

			_mid = _lower + ((_upper - _lower) >> 1)
			switch {
			case data[p] < _ragelbug_trans_keys[_mid]:
				_upper = _mid - 1
			case data[p] > _ragelbug_trans_keys[_mid]:
				_lower = _mid + 1
			default:
				_trans += int(_mid - int(_keys))
				goto _match
			}
		}
		_keys += _klen
		_trans += _klen
	}

	_klen = int(_ragelbug_range_lengths[cs])
	if _klen > 0 {
		_lower := int(_keys)
		var _mid int
		_upper := int(_keys + (_klen << 1) - 2)
		for {
			if _upper < _lower {
				break
			}

			_mid = _lower + (((_upper - _lower) >> 1) & ^1)
			switch {
			case data[p] < _ragelbug_trans_keys[_mid]:
				_upper = _mid - 2
			case data[p] > _ragelbug_trans_keys[_mid + 1]:
				_lower = _mid + 2
			default:
				_trans += int((_mid - int(_keys)) >> 1)
				goto _match
			}
		}
		_trans += _klen
	}

_match:
	_trans = int(_ragelbug_indicies[_trans])
	cs = int(_ragelbug_trans_targs[_trans])

	if _ragelbug_trans_actions[_trans] == 0 {
		goto _again
	}

	_acts = int(_ragelbug_trans_actions[_trans])
	_nacts = uint(_ragelbug_actions[_acts]); _acts++
	for ; _nacts > 0; _nacts-- {
		_acts++
		switch _ragelbug_actions[_acts-1] {
		case 0:
//line decoder.rl:18

        stack[top] = cs; top++; cs = 4; goto _again

    
//line decoder.go:186
		}
	}

_again:
	if cs == 0 {
		goto _out
	}
	p++
	if p != pe {
		goto _resume
	}
	_test_eof: {}
	if p == eof {
		__acts := _ragelbug_eof_actions[cs]
		__nacts := uint(_ragelbug_actions[__acts]); __acts++
		for ; __nacts > 0; __nacts-- {
			__acts++
			switch _ragelbug_actions[__acts-1] {
			case 1:
//line decoder.rl:22

        if err = callbacks.OnArrayData(data[arrayStart:p]); err != nil {
            p++; goto _out

        }
        if err = callbacks.OnArrayEnd(); err != nil {
            p++; goto _out

        }
        firstTwoCharacters = firstTwoCharacters[:0]
        top--; cs = stack[top]
goto _again

    
//line decoder.go:221
			}
		}
	}

	_out: {}
	}

//line decoder.rl:67


    if cs == ragelbug_error {
        err = fmt.Errorf("Parse error at %v", p)
    }

    return
}

parser_test.go

package ragelbug

import (
	"fmt"
	"testing"
)

type testCallbacks struct {
	Value            interface{}
	currentArray     []byte
	currentArrayType ArrayType
}

func (this *testCallbacks) OnArrayBegin(arrayType ArrayType) error {
	this.currentArray = make([]byte, 0, 100)
	this.currentArrayType = arrayType
	return nil
}

func (this *testCallbacks) OnArrayData(bytes []byte) error {
	this.currentArray = append(this.currentArray, bytes...)
	return nil
}

func (this *testCallbacks) OnArrayEnd() error {
	array := this.currentArray
	this.currentArray = nil
	switch this.currentArrayType {
	case ArrayTypeBinary:
		this.Value = array
	case ArrayTypeString:
		this.Value = string(array)
	default:
		return fmt.Errorf("Unhandled array type: %v", this.currentArrayType)
	}
	return nil
}

func decodeDocument(encoded []byte) (result interface{}, err error) {
	callbacks := new(testCallbacks)
	err = Parse(encoded, callbacks)
	if err != nil {
		return nil, err
	}
	result = callbacks.Value
	return result, err
}

func TestUnquotedString(t *testing.T) {
	expected := "abcd"
	actual, err := decodeDocument([]byte(expected))
	if err != nil {
		t.Errorf("Parse error: %v", err)
	}
	if actual != expected {
		t.Errorf("Expected [%v] but got [%v]", expected, actual)
	}
}

Build command (ragel 6.10, go 1.13.3):

go mod init ragelbug
ragel -Z decoder.rl && go test

Result:

--- FAIL: TestUnquotedString (0.00s)
panic: runtime error: index out of range [5] with length 4 [recovered]
	panic: runtime error: index out of range [5] with length 4

goroutine 19 [running]:
testing.tRunner.func1(0xc0000b2100)
	/usr/local/go/src/testing/testing.go:874 +0x3a3
panic(0x5333e0, 0xc0000b6000)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
ragel-bug.Parse(0xc00008c078, 0x4, 0x8, 0x56dce0, 0xc00007c2a0, 0x8, 0x4)
	decoder.go:129 +0x7d4
ragel-bug.decodeDocument(0xc00008c078, 0x4, 0x8, 0xc00008c078, 0x4, 0x8, 0xc1203b284f84)
	/home/karl/Projects/ragel-bug/parser_test.go:41 +0x6e
ragel-bug.TestUnquotedString(0xc0000b2100)
	/home/karl/Projects/ragel-bug/parser_test.go:51 +0x65
testing.tRunner(0xc0000b2100, 0x54f898)
	/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:960 +0x350
exit status 2
FAIL	ragel-bug	0.005s

The failing line (decoder.go line 129, p = 5, data length = 4):

case data[p] < _ragelbug_trans_keys[_mid]:

[ragel] mandelbug causing segfault

$ cat test.rl
%%{
machine test;

action action1 {}
action action2 {}

nl = ("\r\n" | [\n\r]);
kw = "aaaaa";
ident = "bbbbb" @action1;
normal = (kw | ident);

first = ([^\n\r] @action1)* . nl;

cont = (
    (" " @action1 when action1)* .
    (((([^\n\r] @action1)*) . nl @action1) when action1)
);

special = first (cont when action2)** ;

main := (normal when action1) | (special when action1);

}%%
$ ragel test.rl
Segmentation fault
$ ragel -V test.rl
Segmentation fault
$ ragel -T0 test.rl
Segmentation fault
$ ragel -T1 test.rl
Segmentation fault
$ ragel -F0 test.rl
Segmentation fault
$ ragel -F1 test.rl
Segmentation fault
$ ragel -d test.rl
Segmentation fault
$ ragel -e test.rl
Segmentation fault
$ ragel -n test.rl  # succeeds
$ ragel -m test.rl  # succeeds
$

[ragel] generate graphviz off of the FSM graph

Graphviz code generation was implemented off of the reduced machine because of the split between frontend and backend. Now that split is gone, and graphviz code generation forces us to consider making machines that are not complete, which complicates the reduced machine. We should just generate graphviz based off the FSM graph. Doing this naively will mean that the default transition will go away. This may turn out to be better ... not sure yet.

[ragel] fgoto in eof actions does not create label

Results in code that does not compile. Should produce an error? Or maybe just change CS when in the leaving action?

From: Drake Wilson 
To: Debian Bug Tracking System 
Subject: ragel: emitted C code with -G2 in the presence of fgoto fails to compile
Date: Fri, 27 Nov 2009 02:09:04 -0600

Package: ragel
Version: 6.5-1
Severity: normal

Here's a semi-minimal test machine:

/* ---------------------------------------- */
%%{
machine foobar;
alphtype unsigned char;

bar := 'b' @{fbreak;} ;
foo := 'a' %{fgoto bar;} ;
}%%

%%write data;

void
run(unsigned char const *p, unsigned char const *pe)
{
        unsigned char const *const eof = pe;
        int cs;
        %%write init;
        %%write exec;
}
/* ---------------------------------------- */

  $ ragel -C -G2 test.rl && gcc -c test.c
  test.rl: In function ‘run’:
  test.rl:6: error: label ‘st2’ used but not defined

This appears to be because the fgoto for some reason doesn't cause a
label to be generated for the target state, even though one is needed.

   ---> Drake Wilson

[ragel] Unify EOF and regular code generation

Currently duplicating a lot of code and data for the execution of EOF actions and conditions. Goal is to unify this with regular transitions.

Currently we first test if we have p == pe, then check if p == eof. But to make this change we want to first check if p == eof and to treat this like a transition. Otherwise we will need the p == pe test twice.

Doing this could break some poorly coded machines. Better to move to 8.0.

[ragel] add ferror

This ragel statement should put the machine into the error state and then break out. It has been started, but needs to be finished.

[feature request] Basic utf-8 support in rule language

When writing rules for a W3C standard like SPARQL using the notation specified in the XML standard it would be quite convenient if there was some support of converting unicode code points to machines matching utf-8 encoded code point.

E.g. (from the SPARQL specification):

#x00c0 converts to the state machine 0xc3 0x80
[#0x00c0-0x00d0]converts to the state machine 0xc3 0x80..0x96
[#x037F-#x1FFF]converts to 0xCD 0xBF | 0xCE..0xDF 0x80..0xBF | 0xE0..0xE1 0x80..0xBF 0x80..0xBF

(I have not yet verified the examples above, but I hope the idea is clear)

The syntax \u could be used as an alternative to the syntax #x for code points.

[ragel] leaving actions and conditions not fully compatible with scanners

Leaving actions are not always appropriately executed when looping a scanner.
comment: Possibly want to take an optimization approach. For example, compile the machine with the scanner actions placed at a later time (and maybe link them to the possible optimzations. After compilation scan the state machine to see if we can push them back to get back to the optimized scanner solution we had previously.
comment: * If there are no leaving actions, leaving conditions, or leaving priorities, use the current implementation

  • If there is leaving-anything, use an NFA-based implementation.
    comment: There are a couple approaches to solving this problem

Execute the leaving conditions and actions immediately after leaving finish state. Execute the match action only after we switch on act. The problem with this approach is that if we are do do it correctly for tokens that may be extended (for example 'a' '...'?) then we can be violating the ragel execution model. If the 'a' matches and we execute the leaving actions, then continue onward, we could execute the action again.

Go back to a matched token, just before executing the match action and call leaving conditions and execute leaving actions. The problem with this approach is that a leaving condition could cause a match to fail. We would need to test alternatives after the failure.

The fact that both these approaches have problems leads to suggest to make scanners work properly in conjunction with leaving conditions and actions we need to utilized an NFA approach.

Taking the NFA approach means we need a recipe for preserving NFA state (pointers) across buffer blocks.

[ragel] compiler warnings on some 64-bit Windows (Ragel 6.5)

reported by Dave McCaldon

ip_addr_parser.c(442) : warning C4244: '+=' : conversion from '__int64' to 'unsigned int', possible loss of data _trans += (_mid - _keys);
ip_addr_parser.c(465) : warning C4244: '+=' : conversion from '__int64' to 'unsigned int', possible loss of data _trans += ((_mid - _keys)>>1);

[ragel] julia test cases failing on 18.04

ERROR: LoadError: MethodError: no method matching Array{Int64,1}(::Int64)
Closest candidates are:
  Array{Int64,1}() where T at boot.jl:413
  Array{Int64,1}(!Matched::UndefInitializer, !Matched::Int64) where T at boot.jl:394
  Array{Int64,1}(!Matched::UndefInitializer, !Matched::Int64...) where {T, N} at boot.jl:400
  ...
Stacktrace:
 [1] m(::String) at /home/thurston/devel/colm-suite/test/ragel.d/working/any1_julia_e.jl:19
 [2] top-level scope at none:0
 [3] include at ./boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1044
 [5] include(::Module, ::String) at ./sysimg.jl:29
 [6] exec_options(::Base.JLOptions) at ./client.jl:266
 [7] _start() at ./client.jl:425
in expression starting at /home/thurston/devel/colm-suite/test/ragel.d/working/any1_julia_e.jl:107

[ragel] condition transitions should be a list inside transitions on a character range

As it stands, conditions are implemented by expanding to values in the alphabet. This causes the alphabet to grow and makes it impossible to use conditions with long-sized alphabets (no space left). It is also a confusing implementation.

We should instead be representing transition on character as a the usual list, instead of a single transtion in the TransAp struct we should have a list of transitions for each active condition expression. Most of this time will be on the no-condition set.

[ragel] something like define macros

 via_parm   = ( sent_protocol LWS sent_by ( SEMI ( via_branch |
header_param ) )* )
                    >start_value %store_value;
 Via           = ( "Via"i | "v"i ) >write_value >start_field
%write_field HCOLON via_parm
                    ( COMMA %write_value via_parm )*;


So I would like to use smething like a C #define. This is, adding at
the top of my Ragel file:

  #define COMMA_SEPARATED_VALUES(VALUE) ">write_value >start_field
             %write_field HCOLON VALUE ( COMMA %write_value VALUE )*;"

And then in the machine write:

  Via = ( "Via"i | "v"i ) COMMA_SEPARATED_VALUE(via_parm)

Iñaki Baz Castillo [email protected]
[email protected]

configure: error: colm is required to build ragel

I download http://www.colm.net/files/ragel/ragel-7.0.0.12.tar.gz, and build it fail on msys .

MSYS /d/tools/Ragel-6.6/ragel-7.0.0.12
$ ./configure
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ar... ar
checking for ranlib... ranlib
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 24000
checking how to convert x86_64-pc-msys file names to x86_64-pc-msys format... func_convert_file_noop
checking how to convert x86_64-pc-msys file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-msys/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... unknown
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... ./configure: line 7161: cmp: command not found
./configure: line 7161: cmp: command not found

checking how to truncate binary pipes... /usr/bin/sed -e 4q
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... ./configure: line 9101: diff: command not found
no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-pc-msys/bin/ld.exe
checking if the linker (/usr/x86_64-pc-msys/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... no
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-pc-msys/bin/ld.exe) supports shared libraries... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether make sets $(MAKE)... (cached) yes
checking size of int... 4
checking size of long... 8
checking for ragel... no
checking for kelbt... no
checking for colm... no
configure: error: colm is required to build ragel

[ragel] "ragel: rlhc stopped by signal: 11" in Rust generator

I often get this issue:

$ ragel-rust -o scanner.rs scanner_rl.rs
ragel: rlhc stopped by signal: 11

It's difficult to debug. I have had it go away if instead of including a machine from another file I just copy+paste it. Sill diagnosing this.

Edit: If I delete the .ri file I get a (legitimate) parser error and a .ri that doesn't reproduce the original signal 11 error! I have no idea what's going on, but somehow I get the .rl/.ri file combination into a particular bad state, and deleting the .ri resets the state to something that does not necessarily reproduce the bad state...?!? Consequently, I can't consistently reproduce this error. Let me work on it some more until I can.

[ragel] parameterized repetition counts

From Pablo Bleyer:

Is it currently possible to parametrize repetition numbers with
declarations or imported definitions? For example, "bytes{min,max}"
where 'min' and 'max' are defined in an import or constant expression?

2015-01-04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.