Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ ignore:

profiling:
critical_files_paths:
- src/location.ts
- src/reader.ts
- src/constructs/*.ts
- src/parsers/*.parser.ts
6 changes: 5 additions & 1 deletion .commitlintrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import { scopes } from '@flex-development/commitlint-config'
const config: UserConfig = {
extends: ['@flex-development'],
rules: {
'scope-enum': [Severity.Error, 'always', scopes(['chore'])]
'scope-enum': [Severity.Error, 'always', scopes([
'chore',
'constructs',
'parsers'
])]
}
}

Expand Down
2 changes: 2 additions & 0 deletions .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jchen
kaisugi
kata
keyid
kmid
lcov
lintstagedrc
mdast
Expand All @@ -30,6 +31,7 @@ pathe
pkgs
preid
shfmt
succ
tokenizes
unstub
vates
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@
},
"dependencies": {
"@flex-development/docast": "1.0.0-alpha.17",
"@flex-development/esast": "flex-development/esast#c27d63427454b617f92dc1f01a82f3344fca7dc4",
"@flex-development/esast": "flex-development/esast#bc319cc4d5b14e2a55767bbd60ac2bfcb9ae40b2",
"@flex-development/tutils": "6.0.0-alpha.25",
"@flex-development/unist-util-parsec": "flex-development/unist-util-parsec#commit=ce79a1bddd07cc6fbe97d20592e930eb77b5b756",
"@flex-development/unist-util-stringify-position": "1.0.0",
"@flex-development/vfile-lexer": "flex-development/vfile-lexer#commit=a4837a7d1a9c63036ed522c0e844cd7c0ed78428",
"@types/mdast": "4.0.4",
Expand Down Expand Up @@ -134,7 +135,7 @@
"eslint-plugin-promise": "6.2.0",
"eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-yml": "1.14.0",
"globals": "15.6.0",
"globals": "15.8.0",
"growl": "1.10.5",
"husky": "9.0.11",
"is-ci": "3.0.1",
Expand All @@ -158,6 +159,7 @@
"yaml-eslint-parser": "1.2.3"
},
"resolutions": {
"@flex-development/esast": "flex-development/esast#bc319cc4d5b14e2a55767bbd60ac2bfcb9ae40b2",
"@flex-development/unist-util-types": "1.6.1",
"chai": "5.1.1"
},
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/index.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import * as testSubject from '../index'
describe('e2e:esast-util-from-code', () => {
it('should expose public api', () => {
expect(testSubject).to.have.keys([
'AbstractParser',
'Grammar',
'Lexer',
'Parser',
'PunctuatorParser',
'Token',
'errors',
'isLineEnding',
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export * from './enums'
export type * from './interfaces'
export { default as Lexer } from './lexer'
export * from './parsers'
export { default as Token } from './token'
export type * from './types'
export * from './utils'
165 changes: 165 additions & 0 deletions src/parsers/__snapshots__/punctuator.parser.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`unit:parsers/PunctuatorParser > #arrow > should parse "=>" 1`] = `
tokens[2]
├─0 punctuator "=" (1:1-1:2, 0-1)
│ whitespace: ""
└─1 punctuator ">" (1:2-1:3, 1-2)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > #ellipsis > should parse "..." 1`] = `
tokens[3]
├─0 punctuator "." (1:1-1:2, 0-1)
│ whitespace: ""
├─1 punctuator "." (1:2-1:3, 1-2)
│ whitespace: ""
└─2 punctuator "." (1:3-1:4, 2-3)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.ampersand 1`] = `
punctuator "&" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.asterisk 1`] = `
punctuator "*" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.at 1`] = `
punctuator "@" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.backslash 1`] = `
punctuator "\\\\" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.backtick 1`] = `
punctuator "\`" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.bar 1`] = `
punctuator "|" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.caret 1`] = `
punctuator "^" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.colon 1`] = `
punctuator ":" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.comma 1`] = `
punctuator "," (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.dollar 1`] = `
keyid "$" (1:1-1:2, 0-1)
whitespace: ""
private: false
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.dot 1`] = `
punctuator "." (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.equal 1`] = `
punctuator "=" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.exclamation 1`] = `
punctuator "!" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.gt 1`] = `
punctuator ">" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.hash 1`] = `
punctuator "#" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.leftBrace 1`] = `
punctuator "{" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.leftBracket 1`] = `
punctuator "[" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.leftParen 1`] = `
punctuator "(" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.lt 1`] = `
punctuator "<" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.minus 1`] = `
punctuator "-" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.percent 1`] = `
punctuator "%" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.plus 1`] = `
punctuator "+" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.question 1`] = `
punctuator "?" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.rightBrace 1`] = `
punctuator "}" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.rightBracket 1`] = `
punctuator "]" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.rightParen 1`] = `
punctuator ")" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.semicolon 1`] = `
punctuator ";" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.slash 1`] = `
punctuator "/" (1:1-1:2, 0-1)
whitespace: ""
`;

exports[`unit:parsers/PunctuatorParser > chars > should parse chars.tilde 1`] = `
punctuator "~" (1:1-1:2, 0-1)
whitespace: ""
`;
Loading