Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented statements inside actions #106

Open
bottle2 opened this issue Jun 30, 2024 · 0 comments
Open

Commented statements inside actions #106

bottle2 opened this issue Jun 30, 2024 · 0 comments

Comments

@bottle2
Copy link

bottle2 commented Jun 30, 2024

I dunno what is bug and what needs to be clarified in documentation.

I'll just share some experiments. here follows a MSYS2 session:

Nero@DESKTOP-QIBT7ND CLANG64 ~
$ ragel -v
Ragel State Machine Compiler version 6.10 March 2017
Copyright (c) 2001-2009 by Adrian Thurston

Nero@DESKTOP-QIBT7ND CLANG64 ~
$ for i in comment-action-mre*.rl; do echo "Analyzing $i:"; cat "$i"; ragel "$i"; echo "Ragel returned $?"; done;
Analyzing comment-action-mre1.rl:
%%{
    machine mre1;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            fgoto error; // We DO expect an error here!
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre1.rl:6:1: could not resolve state reference error
Ragel returned 1
Analyzing comment-action-mre2.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            #fgoto error; Should we expect an error here?
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre2.rl:7: could not resolve state reference error
Ragel returned 1
Analyzing comment-action-mre3.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            //fgoto error; Should we expect an error here?
    }
    main := "Hello, world!" $debug;
}%%
Ragel returned 0
Analyzing comment-action-mre4.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            /*fgoto error; Should we expect an error here?*/
    }
    main := "Hello, world!" $debug;
}%%
Ragel returned 0
Analyzing comment-action-mre5.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
#if 0
            fgoto error; Should we expect an error here?
#endif
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre5.rl:8:9: could not resolve state reference error
Ragel returned 1

Nero@DESKTOP-QIBT7ND CLANG64 ~
$

here follows the same session on Android:

~/downloads $ ragel -v
Ragel State Machine Compiler version 7.0.4 February 2021
Copyright (c) 2001-2021 by Dr. Adrian D. Thurston et al.
~/downloads $ for i in comment-action-mre*.rl; do echo "Analyzing $i:"; cat "$i"; ragel "$i"; echo "Ragel returned $?"; done;
Analyzing comment-action-mre1.rl:
%%{
    machine mre1;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            fgoto error; // We DO expect an error here!
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre1.rl:6:13: could not resolve state reference error
Ragel returned 0
Analyzing comment-action-mre2.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            #fgoto error; Should we expect an error here?
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre2.rl:7:14: could not resolve state reference error
Ragel returned 0
Analyzing comment-action-mre3.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            //fgoto error; Should we expect an error here?
    }
    main := "Hello, world!" $debug;
}%%
Ragel returned 0
Analyzing comment-action-mre4.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
            /*fgoto error; Should we expect an error here?*/
    }
    main := "Hello, world!" $debug;
}%%
Ragel returned 0
Analyzing comment-action-mre5.rl:
%%{
    machine mre2;
    action debug {
        printf("I got %c!\n", fc);
        if ('@' == fc)
            ;
#if 0
            fgoto error; Should we expect an error here?
#endif
    }
    main := "Hello, world!" $debug;
}%%
comment-action-mre5.rl:8:13: could not resolve state reference error
Ragel returned 0
~/downloads $

haha "Android". I mean specifically Termux:

~/downloads $ uname -a
Linux localhost 4.19.191-g7dd98df8b4b4 #1 SMP PREEMPT Fri Mar 29 17:48:13 CST 2024 aarch64 Android

anyway, I don't really expect anything from this issue, just fixing funny warnings because I wrote a lot of Ragel before trying to compile for the first time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant