Skip to content

(CPP) Declaring multiple variables with parentheticals treated as invalid #3148

Closed
@edemaine

Description

@edemaine

Declaring multiple variadic variables with initializers generates an invalid error.

Example code (which Github also seems to highlight inconsistently):

vector<int> e(n), depth(n);

Highlight.js 10.4.0 and 10.7.2 generate an Illegal lexeme "," for mode "function" error. Direct reproduction:

require('highlight.js/lib/core').highlight('vector<int> e(n), depth(n);', {language: 'cpp'})

Issue #2917 seems related, and perhaps this has a similarly easy fix.

On the plus side, I just learned about the ignoreIllegals setting, so I'll probably just switch to using that in my context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions