[Bro-Dev] [JIRA] (BIT-1237) Bro script declaration ordering

Jon Siwek (JIRA) jira at bro-tracker.atlassian.net
Tue Mar 17 11:12:00 PDT 2015


     [ https://bro-tracker.atlassian.net/browse/BIT-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Siwek updated BIT-1237:
---------------------------
    Description: 
During one of the scripting exercises I noticed odd behavior with items declared in the global scope:

{code}
############################# error.bro
not working:
------------------------------------------------
local test_var = "test_var";

function test_1()
    {
    print "test_1";
    }

print test_var;
test_1();

>>> Output:
error in ./test.bro, line 3: syntax error, at or near "test_1"


############################# working.bro
working:
------------------------------------------------

function test_1()
    {
    print "test_1";
    }

local test_var = "test_var";
print test_var;
test_1();

>>> Output:
test_var
test_1

#############################
{code}

To declare a function, bro 2.3 forced me to do it at the top of the file. On the exercise with the redef of the grid ftp size variable I noticed the same issue with redef, it required me to put the redef at the very top of the file. 

Robin asked me to open a ticket and mentioned this was low priority.

  was:
During one of the scripting exercises I noticed odd behavior with items declared in the global scope:

############################# error.bro
not working:
------------------------------------------------
local test_var = "test_var";

function test_1()
    {
    print "test_1";
    }

print test_var;
test_1();

>>> Output:
error in ./test.bro, line 3: syntax error, at or near "test_1"


############################# working.bro
working:
------------------------------------------------

function test_1()
    {
    print "test_1";
    }

local test_var = "test_var";
print test_var;
test_1();

>>> Output:
test_var
test_1

#############################

To declare a function, bro 2.3 forced me to do it at the top of the file. On the exercise with the redef of the grid ftp size variable I noticed the same issue with redef, it required me to put the redef at the very top of the file. 

Robin asked me to open a ticket and mentioned this was low priority.


> Bro script declaration ordering
> -------------------------------
>
>                 Key: BIT-1237
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1237
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>    Affects Versions: 2.3
>         Environment: Bro con training VM
>            Reporter: Peter Kaloroumakis
>            Priority: Trivial
>              Labels: BroScript
>
> During one of the scripting exercises I noticed odd behavior with items declared in the global scope:
> {code}
> ############################# error.bro
> not working:
> ------------------------------------------------
> local test_var = "test_var";
> function test_1()
>     {
>     print "test_1";
>     }
> print test_var;
> test_1();
> >>> Output:
> error in ./test.bro, line 3: syntax error, at or near "test_1"
> ############################# working.bro
> working:
> ------------------------------------------------
> function test_1()
>     {
>     print "test_1";
>     }
> local test_var = "test_var";
> print test_var;
> test_1();
> >>> Output:
> test_var
> test_1
> #############################
> {code}
> To declare a function, bro 2.3 forced me to do it at the top of the file. On the exercise with the redef of the grid ftp size variable I noticed the same issue with redef, it required me to put the redef at the very top of the file. 
> Robin asked me to open a ticket and mentioned this was low priority.



--
This message was sent by Atlassian JIRA
(v6.4-OD-15-055#64014)


More information about the bro-dev mailing list