Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Fix tab #10

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add all new character classes, clean up comments
  • Loading branch information
corsonknowles committed Aug 9, 2017
commit b176e2d5b6dcfe483d420c6a05a70bb913b97d25
2 changes: 0 additions & 2 deletions lib/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ class Builder {
/**
* Match any non-digit character (in given span). Default will be any character not between 0 and 9.
*
* @param {number} min
* @param {number} max
* @return {Builder}
*/
noDigit() {
Expand Down
15 changes: 6 additions & 9 deletions lib/Language/Helpers/methodMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ const mapper = {
'begin with': { 'class': SimpleMethod, 'method': 'startsWith' },
'begins with': { 'class': SimpleMethod, 'method': 'startsWith' },
'must end': { 'class': SimpleMethod, 'method': 'mustEnd' },
// \A start of string, contrast with ^ which breaks at new lines
'string begin with' : { 'class': SimpleMethod, 'method': 'stringStartsWith' },
'string begins with' : { 'class': SimpleMethod, 'method': 'stringStartsWith' },
'string starts with' : { 'class': SimpleMethod, 'method': 'stringStartsWith' },
// \A start of string
// \z end of string
// \z end of string, contrast with $ which breaks at new lines
'string must end': { 'class': SimpleMethod, 'method': 'stringMustEnd' },

'once or more': { 'class': SimpleMethod, 'method': 'onceOrMore' },
'never or more': { 'class': SimpleMethod, 'method': 'neverOrMore' },
'new line': { 'class': SimpleMethod, 'method': 'newLine' },
Expand All @@ -36,21 +35,19 @@ const mapper = {
'anything': { 'class': SimpleMethod, 'method': 'any' },
'tab': { 'class': SimpleMethod, 'method': 'atb' },
'digit': { 'class': SimpleMethod, 'method': 'digit' },
// "\d"
// "\d" any non-digit character
'no digit': { 'class': SimpleMethod, 'method': 'noDigit' },
'number': { 'class': SimpleMethod, 'method': 'digit' },
'letter': { 'class': SimpleMethod, 'method': 'letter' },
'uppercase': { 'class': SimpleMethod, 'method': 'uppercaseLetter' },
'once': { 'class': SimpleMethod, 'method': 'once' },
'twice': { 'class': SimpleMethod, 'method': 'twice' },

// \b \B word, not-word boundary
// \b \B word boundary
'word': { 'class': SimpleMethod, 'method': 'word' },
// \B not-word boundary
'non-word': { 'class': SimpleMethod, 'method': 'nonWord' },
// carriage return
// \r
// carriage return \r
'carriage return': { 'class': SimpleMethod, 'method': 'carriageReturn' },

'literally': { 'class': DefaultMethod, 'method': 'literally' },
'either of': { 'class': DefaultMethod, 'method': 'anyOf' },
'any of': { 'class': DefaultMethod, 'method': 'anyOf' },
Expand Down