Skip to content

Sequence query #13

@Fandangi

Description

@Fandangi

In the following line, I am trying to catch 'var', '=' and 'somevar' separately and assign styles.

var=somevar

I have defined in the lex section 'var', eq and 'subs', and these work well.

    ,"var"                      	: "RE::/(var)(?:(?=\\s)|(?=\\t)|(?==)|$)/gim"
    ,"eq"                      		: "RE::/\\s*=\\s*/gim"
    ,"subs"                   		: "RE::/[A-Za-z$][A-Za-z0-9$]*/"

I am having trouble with the 'somevar' part as I believe I can only identify it accurately as a subs type following after types var and eq.

My sequence is currently

"Syntax"                            : {
    "subs1"                  : {"sequence":["var", "eq", "subs"]}
    ,"js"                           : " comment | eq | operator | var | subs1 | subs | keyword  "
},

Am I being too hopeful, or is there a correct approach to the above requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions