Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a test for identifier support across all languages #2371

Merged
merged 3 commits into from Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/prism-apl.js
Expand Up @@ -4,7 +4,7 @@ Prism.languages.apl = {
pattern: /'(?:[^'\r\n]|'')*'/,
greedy: true
},
'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i,
'number': /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i,
'statement': /:[A-Z][a-z][A-Za-z]*\b/,
'system-function': {
pattern: /⎕[A-Z]+/i,
Expand All @@ -29,4 +29,4 @@ Prism.languages.apl = {
pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
alias: 'builtin'
}
};
};
2 changes: 1 addition & 1 deletion components/prism-apl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions components/prism-asm6502.js
Expand Up @@ -6,19 +6,19 @@ Prism.languages.asm6502 = {
},
'string': /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
'opcode': {
pattern: /\b(?:adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya|ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\b/,
pattern: /\b(?:adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya|ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\b/,
alias: 'property'
},
'hexnumber': {
pattern: /#?\$[\da-f]{2,4}/i,
pattern: /#?\$[\da-f]{2,4}\b/i,
alias: 'string'
},
'binarynumber': {
pattern: /#?%[01]+/,
pattern: /#?%[01]+\b/,
alias: 'string'
},
'decimalnumber': {
pattern: /#?\d+/,
pattern: /#?\b\d+\b/,
alias: 'string'
},
'register': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-asm6502.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion components/prism-css-extras.js
Expand Up @@ -69,7 +69,7 @@
});

var unit = {
pattern: /(\d)(?:%|[a-z]+)/,
pattern: /(\b\d+)(?:%|[a-z]+\b)/,
lookbehind: true
};
// 123 -123 .123 -.123 12.3 -12.3
Expand Down Expand Up @@ -101,6 +101,7 @@
}
}
],
// it's import that there is no boundary assertion after the hex digits
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
'entity': /\\[\da-f]{1,8}/i,
'unit': unit,
'number': number
Expand Down
2 changes: 1 addition & 1 deletion components/prism-css-extras.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-ebnf.js
Expand Up @@ -15,7 +15,7 @@ Prism.languages.ebnf = {
lookbehind: true,
alias: ['rule', 'keyword']
},
'rule': /[a-z]\w*(?:[ \t]+[a-z]\w*)*/i,
'rule': /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,

'punctuation': /\([:/]|[:/]\)|[.,;()[\]{}]/,
'operator': /[-=|*/!]/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-ebnf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-eiffel.js
Expand Up @@ -30,7 +30,7 @@ Prism.languages.eiffel = {
// hexa | octal | bin
/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
// Decimal
/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/i
/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i
],
'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
'operator': /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-eiffel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions components/prism-excel-formula.js
Expand Up @@ -38,11 +38,11 @@ Prism.languages['excel-formula'] = {
}
},
'function-name': {
pattern: /[A-Z]\w*(?=\()/i,
pattern: /\b[A-Z]\w*(?=\()/i,
alias: 'keyword'
},
'range': {
pattern: /\$?(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)/i,
pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,
alias: 'property',
inside: {
'operator': /:/,
Expand All @@ -54,7 +54,7 @@ Prism.languages['excel-formula'] = {
'cell': {
// Excel is case insensitive, so the string "foo1" could be either a variable or a cell.
// To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise.
pattern: /[A-Z]+\d+|\$[A-Za-z]+\$?\d+|[A-Za-z]+\$\d+/,
pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,
alias: 'property'
},
'number': /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-excel-formula.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions components/prism-hcl.js
Expand Up @@ -26,9 +26,7 @@ Prism.languages.hcl = {
}
}
},
{
pattern: /[\w-]+(?=\s+{)/
}
/[\w-]+(?=\s+{)/
],
'property': [
/[\w-\.]+(?=\s*=(?!=))/,
Expand All @@ -53,13 +51,13 @@ Prism.languages.hcl = {
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
greedy: true,
},
'number': /\b0x[\da-f]+|\d+\.?\d*(?:e[+-]?\d+)?/i,
'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i,
'punctuation': /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/,
}
},
}
},
'number': /\b0x[\da-f]+|\d+\.?\d*(?:e[+-]?\d+)?/i,
'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i,
'boolean': /\b(?:true|false)\b/i,
'punctuation': /[=\[\]{}]/,
};