Skip to content

Commit

Permalink
chore: fix layout case
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Nov 21, 2023
1 parent 5b0e90e commit c1c7215
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const BINARY_OPERATORS = [
// TODO: this is GLSL-only, separate language constants
const TYPE_REGEX = /^(void|bool|float|u?int|[uib]?vec\d|mat\d(x\d)?)$/
const QUALIFIER_REGEX = /^(const|uniform|in|out|inout|centroid|flat|smooth|invariant|lowp|mediump|highp)$/
const VARIABLE_REGEX = new RegExp(`${TYPE_REGEX.source}|${QUALIFIER_REGEX.source}`)
const VARIABLE_REGEX = new RegExp(`${TYPE_REGEX.source}|${QUALIFIER_REGEX.source}|layout`)

const isDeclaration = RegExp.prototype.test.bind(VARIABLE_REGEX)

Expand Down
2 changes: 1 addition & 1 deletion tests/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('parser', () => {

{
const statement = parse(
' layout(location = 0, component = 1, column_major) flat in mat4 test;',
'layout(location = 0, component = 1, column_major) flat in mat4 test;',
)[0] as VariableDeclaration
expect(statement).toBeInstanceOf(VariableDeclaration)
expect(statement.type).toBeInstanceOf(Type)
Expand Down

0 comments on commit c1c7215

Please sign in to comment.